How to stop Neo4j running in Docker?

Viewed 539

I start Neo4j with docker run neo4j and when I run cypher-shell "show database neo4j" in the container, the status is online. However, running

neo4j status

gives Neo4j is not running.

I am a little confused by this. How can I stop the Neo4j in the container? neo4j stop obviously does not work.

2 Answers

On cypher-shell, you would need to give stop database <database-name>

For make dump database I was using this. First of all you have to stop neo4j container.

docker run --interactive --tty --rm \
   --volume=<dir_where_data_is_stored>/data:/data \  
   --volume=<dir_where_backups_will_stored>/backups:/backups \  
   neo4j:3.5 \
neo4j-admin dump --to=/backups/<dump_name>.dump

I had error

command failed: unable to dump database: AccessDeniedException: /backups

So I simply changed

--to=/backups/database.dump

to

--to=/data/database.dump

Reference: https://neo4j.com/docs/operations-manual/current/docker/maintenance/

Related