Recover Arangodb databases from /var/lib/databases directory? - arangodb

In some beta version of Arangodb 3.4 my database crashed while I tried to add a view via arangosh. Because I were not able to start the database anymore, it was not possible to make a backup (database dump).
I just wanted to install the newest Arangodb 3.4.2.1 then, but that failed because my CPU was to old (no SSE 4.2 support). So I bought a new computer, sat up a new linux, copied the databases to /var/lib/arangodb3/databases, started a new installation of Arangodb in which it even asked me, if the current databases should be upraded. I confirmed that.
Unfortunately it hasn't found the databases in that directory, so I have now just acces to the system database.
My question is: Can I recover the databases which are laying in /var/lib/arangodb3/databases somehow?

Do you have a copy of the "var/lib/arangodb3" directory (which includes "databases" as a subfolder) as well? If so, copy the folder to a location on your new machine where Arangodb 3.4.2.1 is installed. You also have to make sure to give the user arangodb access to this folder with the following command:
chown -R arangodb:arangodb /path/to/your/arangodb3RecoveryFolder
Next you can modify the arangod.conf (located at /etc/arangodb3/arangod.conf) to point to your recovery arangodb3 folder.
[database]
directory = /path/to/your/arangodb3RecoveryFolder
Then stop the arangodb3 service with sudo service arangodb3 stop,
run sudo service arangodb3 upgrade to upgrade the database directory and sudo service arangodb3 start to start the service again.
You can check if the service is running by executing sudo service arangodb3 status. In case it is not working, have a look at potential error messages in the log file (/var/log/arangodb3/arangod.log).

Related

Database 'neo4j' is unavailable. Cannot reset neo4j database

I have my community 4.1.1 neo4j service installed on the ubuntu commandline running on my windows machine. I have been using neo4j steadily for a month or two now, just recently it has prevented me from accessing the neo4j database, it will say this in neo4j browser:
Database 'neo4j' is unavailable. Run :sysinfo for more info.
I have tried uninstalling neo4j and reinstalling but that has not worked either. I tried playing around with the default listen address previously, but now with the reinstall all config data is back to normal. Running ./neo4j-community-4.1.1/bin/cypher-shell under bin does not work. It says:
Unable to establish connection in 3000ms
If I run ./neo4j-community-4.1.1/bin/cypher-shell -a 192.168.0.19 it says:
Database 'neo4j' is unavailable
When I run ./neo4j-community-4.1.1/bin/neo4j-admin check-consistency --database=neo4j it also states:
.2020-08-18 22:12:16.868+0000 WARN [o.n.c.ConsistencyCheckService] Index was dirty on startup which means it was not shutdown correctly and need to be cleaned up with a successful recovery. Index file: /home/thomp105/neo4j-community-4.1.1/data/databases/neo4j/neostore.relationshipgroupstore.db.id.
I would love to reset everything from scratch but I am unsure how
At this point I cannot even access the browser at localhost:7474. It hangs indefinitely trying to load.
I am truly stumped. Anyone have any advice on how I navigate this issue?
It's not easy to guess the issue without seeing your system, but may I ask if you can try to delete your default database, i.e. neo4j physically from the disk (e.g. rm -rf /home/thomp105/neo4j-community-4.1.1/data/databases/neo4j/), and then try to create another database with different name instead (open neo4j.conf, search for dbms.active_database, which point out on default database, and change it to some other name)?
I had this problem running on a linux server. The server was up but got this error on any query: Database 'neo4j' is unavailable. To troubleshoot I ran sudo neo4j console and the problem went away. When I ran the console as user ne04j the problem came back.
$ /usr/share/neo4j/bin/neo4j console
Directories in use:
home: /var/lib/neo4j
config: /etc/neo4j
logs: /var/log/neo4j
plugins: /var/lib/neo4j/plugins
import: /var/lib/neo4j/import
data: /var/lib/neo4j/data
certificates: /var/lib/neo4j/certificates
run: /var/run/neo4j
So I tried: sudo chown -R neo4j:neo4j /var/lib/neo4j/data and the problem went away. Apparently when I'd done a restore of the database I'd run the neo4j server as root and when the system runs neo4j it does it as the user neo4j so couldn't read any of its data. It seems that an error like this would warrant an easy to parse error message but verbosity is not the neo4j way.

Postgresqll 10: Postgres User /sbin/nologin preventing initdb setup

I'm attempting to install postgresql 10 for the first time and need to run the initdb setup. Unfortunately, this fails and returns an error from the nologin shell.
server# /usr/pgsql-10/bin/postgresql-10-setup initdb
Initializing database ...
failed, see /var/lib/pgsql/10/initdb.log
server# cat /var/lib/pgsql/10/initdb.log
This account is currently not available.
I strace'd the command and verified the su commands are probably what's causing this and it seems the default setting for the postgres user is /sbin/nologin. In various examples I've seen, there is no mention of this being a possible issue. How would this work on any other system by default? I feel that temporarily modifying the login shell would work but I want to understand this issue better more specifically from the application's end.
centos 7.8
selinux mode: permissive
postgresql 10

Can't connect to database from snapshot. Ubuntu 18.04 postgres 9.5

I'm trying to connect to database restored from disk snapshot. I have new VM with ubuntu 18.04. I installed postgres, postgres-client and postgres-contrib from *.deb files. Then I mounted managed disk into machine with database and tried to connect - no success.
Postgres server running good, cluster ok, status ok, pg_isready ok. Until I change the data_directory in postgresql.conf from default to mounted - /snapshot_data_path/. After that my cluster is down and I cannot use psql in postgres (error ~ .s.PGSQL missing. File dissapearing from default directory).
chown -R to /snapshot_data_path - done, looks ok.
I think my database is running manualy when I use :
/usr/lib/postgresql/9.5/bin/postgres -d 3 -D /database/postgresql/9.5/main -c config_file=/etc/postgresql/9.5/main/postgresql.conf with that new path. EDIT: Error, I can connect but no data inside.
I try search over the internet for similar problems - no luck.
Is it possible to take database from 1 VM and connect it with another fresh VM? Or I must use pg_dump to achieve that?
Here the official documentation on this topic: https://www.postgresql.org/docs/9.0/backup-file.html
The database server must be shut down in order to get a usable backup.
Did you shutdown the server while the data snapshot was taken?

CouchDB won't delete existing database

I am new to CouchDB and have run into an odd issue. I can create a database but can't delete it.
I am setting up a test framework which will create the test version of the DB at the start and delete it at the end of the test run but I don't really want to have the framework SSH to the server as suggested in this answer Delete couchDB databases.
My setup is CentOS 7 (from the released minimal image) running in Virtual Box 4.3. I installed CouchDB from the EPEL repository, the version is reported as 1.6.1. I can manage the DB with Futon to create the database, add and delete documents. Deleting the DB in Futon hangs. Deleting with curl returns 404 not found.
$ curl -X PUT http://dbserver:5984/test
{"ok":true}
$ curl -X DELETE http://dbserver:5984/test
{"error":"not_found","reason":"missing"}
Based on the CouchDB documentation that is the correct URL to delete the DB. I disabled SELinux but that had no effect. No CouchDB security has been enabled, all settings are left at their default.
Why can't I delete the DB?
The problem seems to be a missing SELinux policy.
Running SELinux in Permissive mode, makes the "verify installation" checks work for me. (CentOS 7, couchdb 1.6.1 installed via yum from the EPEL repository).
Looking in /var/audit/audit.log reveals:
type=AVC msg=audit(1422956916.341:371): avc: denied { create } for pid=2188 comm="beam" name=".test_suite_db_design" scontext=system_u:system_r:rabbitmq_beam_t:s0 tcontext=system_u:object_r:couchdb_var_lib_t:s0 tclass=dir
So, SELinux denied the couchdb process to create that directory.
Using the audit2allow tool one may create the missing rules which could be enabled using semodule command:
grep couchdb /var/log/audit/audit.log | audit2allow -M couchdbvarlib
semodule -i couchdbvarlib.pp
See here.
There's already a bug reported against CouchDB in Fedora #1098802

couchdb dead but pid file exists

I have a Centos 6.4 x64 server with epel repo enabled. I installed couchdb via the yum package manager (version 1.0.4) with no errors. I edited the /etc/couchdb/local.ini file with my port (default 5984) and server ip address. Whenever I run the service couchdb start, it returns the ok message:
Starting couchdb: [ OK ]
However, if I run a service couchdb status right after, I get this:
couchdb dead but pid file exists
and, of course, the server does not work.
The weird part is that service couchdb start always returns the success message, although the server never actually runs. Also, there is no log files created at all by couchdb (my /var/log/couchdb/ folder is empty - doubled checked couchdb configuration files for the path).
When I delete the /var/run/subsys/couchdb.pid file, service shows couchdb as not started, and when I try to restart couchdb (service couchdb start), I get the success message again and so on.
Any help will be greatly appreciated. :)
EDIT: I forgot to mention that when I run couchdb it works fine (giving me only this warning warning: "TODO: max is currently unsupported"), so it is just the service that doesn't work.
May be there are so many instances running for couchdb you have to kill each and every and then restart the servcie. Hope it works fine.

Resources