如何从docker中的neo4j获取转储?

编程入门 行业动态 更新时间:2024-10-26 08:27:55
本文介绍了如何从docker中的neo4j获取转储?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 docker run -d -v /home/data:/data --name=neo neo4j

在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获取转储?

本文发布于:2023-10-20 03:35:04,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1509723.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:docker   neo4j

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!