在docker中运行neo4j之后, docker exec -it neo bash
after I run a neo4j in docker, docker exec -it neo bash
./neo4j-admin dump --database=graph.db --to=/home/2018.dump它将说neo4j正在运行 command failed: the database is in use -- stop Neo4j and try again
it will say neo4j is running command failed: the database is in use -- stop Neo4j and try again
,但./neo4j stop将获得neo4j not running
我该怎么办?
推荐答案我之前也遇到过同样的问题,所以我写了这个变通办法来转储neo4j数据并将其从容器中拉到主机上.
I had the same issue before, so I wrote this workaround to dump neo4j data and pull it outside the container to the host machine.
docker rm --force neo4j-dump docker run \ --name neo4j-dump \ --env-file /storage/bin/.neo4j.env \ --mount type=bind,source=<neo4j_data_folder>,target=/data \ neo4j bin/neo4j-admin dump --database=graph.db --to=/graph.db.dump docker cp `docker ps -aqf "name=neo4j-dump"`:/graph.db.dump <target_dump_file> docker rm --force neo4j-dump这将创建一个新的容器并转储数据,而不是启动neo4j服务,然后将转储复制到主机, 只需更新并更新到您的
This will create a new container and dump data instead of starting neo4j service, then copy the dump to the host, just update and to yours
更多推荐
如何从docker中的neo4j获取转储?
发布评论