在 unix 中离线备份 neo4j 社区版:mac 或 linux [英] Backup neo4j community edition offline in unix: mac or linux
问题描述
以前我在制作备份"时遇到问题,如 问题我在尝试恢复数据库时遇到错误,因为我在数据库运行时做了一个副本.
Previously I had a problem when making a 'backup' as shown in this question where I get an error when trying to restore the database because I did a copy when the database was running.
所以我用另一台计算机上的新数据库做了一个实验(这次是用 ubuntu)我尝试了这个:
So I did an experiment with a new database from another computer (this time with ubuntu) I tried this:
- 我创建了一些节点和关系,很少有 10 个(矩阵示例).
- 然后我停止了neo4j服务
- 我将包含 graph.db 的文件夹数据复制到另一个位置
- 之后我删除了graph.db文件夹并启动了neo4j
- 它自动创建了一个新的 graph.db 文件夹,并且数据库在没有任何数据的情况下像新的一样运行,这是正常的.
- 然后我又停下来粘贴旧的 graph.db 文件夹
我得到一个错误:
Starting Neo4j Server...WARNING: not changing user waiting
for server to be ready... Failed to start within 120 seconds.
错误在 5 秒后出现,而不是在 120 秒后出现.
The error appears after 5 seconds not after 120 seconds.
- 我尝试粘贴名为 data 的文件夹.同样的错误.
- I tried pasting the folder called data. Same error.
neo4j社区离线如何手动备份恢复?
我在一些帖子中读到,您只能复制和恢复,但这是行不通的.
I read in some posts that you only copy and restore but that does not work.
感谢您的帮助
推荐答案
在线备份,即在 Neo4j 运行时进行一致备份,仅在 Neo4j 企业版中可用.企业版的备份还具有备份的详细一致性检查功能,这是您在社区中也无法获得的.
Online backup, in a sense of taking a consistent backup while Neo4j is running, is only available in Neo4j enterprise edition. Enterprise edition's backup also features a verbose consistency check of the backup, something you do not get in community either.
社区版中唯一安全的选择是彻底关闭 Neo4j 并递归复制 graph.db 文件夹.我通常使用:
The only safe option in community edition is to shutdown Neo4j cleanly and copy away the graph.db folder recursively. I'm typically using:
cd data
tar -zcf graph.db.tar.gz graph.db/
要恢复,请关闭 neo4j,清理现有的 graph.db 文件夹并从备份中恢复原始 graph.db 文件夹:
For restoring you shut down neo4j, clean out a existing graph.db folder and restore the original graph.db folder from your backup:
cd data
rm -rf graph.db
tar -zxf graph.db.tar.gz
这篇关于在 unix 中离线备份 neo4j 社区版:mac 或 linux的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!