我在我的linux服务器上使用neo4j-community-2.2.5。我正在尝试备份并将neo4j数据恢复到另一个Linux服务器。当我试图启动服务器意味着它在日志文件上显示以下错误。
2015-10-16 08:02:20.757+0000 INFO [API] Setting startup timeout to: 120000ms based on 120000
2015-10-16 08:02:21.266+0000 ERROR [API] Failed to start database.
java.lang.RuntimeException: Error starting org.neo4j.kernel.EmbeddedGraphDatabase, /usr/local/neo4j-community-2.2.5/data/graph.db
at org.neo4j.kernel.InternalAbstractGraphDatabase.run(InternalAbstractGraphDatabase.java:335) ~[neo4j-kernel-2.2.5.jar:2.2.5]
at org.neo4j.kernel.EmbeddedGraphDatabase.<init>(EmbeddedGraphDatabase.java:59) ~[neo4j-kernel-2.2.5.jar:2.2.5]
at org.neo4j.server.database.LifecycleManagingDatabase$1.newGraphDatabase(LifecycleManagingDatabase.java:44) ~[neo4j-server-2.2.5.jar:2.2.5]
at org.neo4j.server.database.LifecycleManagingDatabase.start(LifecycleManagingDatabase.java:110) ~[neo4j-server-2.2.5.jar:2.2.5]
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:507) ~[neo4j-kernel-2.2.5.jar:2.2.5]
at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:115) ~[neo4j-kernel-2.2.5.jar:2.2.5]
at org.neo4j.server.AbstractNeoServer.start(AbstractNeoServer.java:203) ~[neo4j-server-2.2.5.jar:2.2.5]
at org.neo4j.server.Bootstrapper.start(Bootstrapper.java:117) ~[neo4j-server-2.2.5.jar:2.2.5]
at org.neo4j.server.Bootstrapper.main(Bootstrapper.java:69) ~[neo4j-server-2.2.5.jar:2.2.5]
Caused by: org.neo4j.kernel.lifecycle.LifecycleException: Component 'org.neo4j.kernel.StoreLockerLifecycleAdapter@fef4f5a' was successfully initialized, but failed to start. Please see attached cause exception.
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:513) ~[neo4j-kernel-2.2.5.jar:2.2.5]
at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:115) ~[neo4j-kernel-2.2.5.jar:2.2.5]
at org.neo4j.kernel.InternalAbstractGraphDatabase.run(InternalAbstractGraphDatabase.java:331) ~[neo4j-kernel-2.2.5.jar:2.2.5]
... 8 common frames omitted
Caused by: org.neo4j.kernel.StoreLockException: Unable to obtain lock on store lock file: /usr/local/neo4j-community-2.2.5/data/graph.db/store_lock. Please ensure no other process is using this database, and that the directory is writable (required even for read-only access)
at org.neo4j.kernel.StoreLocker.checkLock(StoreLocker.java:78) ~[neo4j-kernel-2.2.5.jar:2.2.5]
at org.neo4j.kernel.StoreLockerLifecycleAdapter.start(StoreLockerLifecycleAdapter.java:44) ~[neo4j-kernel-2.2.5.jar:2.2.5]
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:507) ~[neo4j-kernel-2.2.5.jar:2.2.5]
... 10 common frames omitted
Caused by: java.io.FileNotFoundException: /usr/local/neo4j-community-2.2.5/data/graph.db/store_lock (Permission denied)
at java.io.RandomAccessFile.open(Native Method) ~[na:1.7.0_25]
at java.io.RandomAccessFile.<init>(RandomAccessFile.java:233) ~[na:1.7.0_25]
at org.neo4j.io.fs.DefaultFileSystemAbstraction.open(DefaultFileSystemAbstraction.java:54) ~[neo4j-io-2.2.5.jar:2.2.5]
at org.neo4j.io.fs.DefaultFileSystemAbstraction.open(DefaultFileSystemAbstraction.java:45) ~[neo4j-io-2.2.5.jar:2.2.5]
at org.neo4j.kernel.StoreLocker.checkLock(StoreLocker.java:73) ~[neo4j-kernel-2.2.5.jar:2.2.5]
... 12 common frames omitted
2015-10-16 08:02:21.267+0000 INFO [API] Successfully shutdown Neo4j Server.
2015-10-16 08:02:21.268+0000 ERROR [API] Failed to start Neo Server on port [7474]
org.neo4j.server.ServerStartupException: Starting Neo4j Server failed: Component 'org.neo4j.server.database.LifecycleManagingDatabase@34e2e2f2' was successfully initialized, but failed to start. Please see attached cause exception.
at org.neo4j.server.AbstractNeoServer.start(AbstractNeoServer.java:258) ~[neo4j-server-2.2.5.jar:2.2.5]
at org.neo4j.server.Bootstrapper.start(Bootstrapper.java:117) [neo4j-server-2.2.5.jar:2.2.5]
at org.neo4j.server.Bootstrapper.main(Bootstrapper.java:69) [neo4j-server-2.2.5.jar:2.2.5]
Caused by: org.neo4j.kernel.lifecycle.LifecycleException: Component 'org.neo4j.server.database.LifecycleManagingDatabase@34e2e2f2' was successfully initialized, but failed to start. Please see attached cause exception.
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:513) ~[neo4j-kernel-2.2.5.jar:2.2.5]
at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:115) ~[neo4j-kernel-2.2.5.jar:2.2.5]
at org.neo4j.server.AbstractNeoServer.start(AbstractNeoServer.java:203) ~[neo4j-server-2.2.5.jar:2.2.5]
... 2 common frames omitted
Caused by: java.lang.RuntimeException: Error starting org.neo4j.kernel.EmbeddedGraphDatabase, /usr/local/neo4j-community-2.2.5/data/graph.db
at org.neo4j.kernel.InternalAbstractGraphDatabase.run(InternalAbstractGraphDatabase.java:335) ~[neo4j-kernel-2.2.5.jar:2.2.5]
at org.neo4j.kernel.EmbeddedGraphDatabase.<init>(EmbeddedGraphDatabase.java:59) ~[neo4j-kernel-2.2.5.jar:2.2.5]
at org.neo4j.server.database.LifecycleManagingDatabase$1.newGraphDatabase(LifecycleManagingDatabase.java:44) ~[neo4j-server-2.2.5.jar:2.2.5]
at org.neo4j.server.database.LifecycleManagingDatabase.start(LifecycleManagingDatabase.java:110) ~[neo4j-server-2.2.5.jar:2.2.5]
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:507) ~[neo4j-kernel-2.2.5.jar:2.2.5]
... 4 common frames omitted
Caused by: org.neo4j.kernel.lifecycle.LifecycleException: Component 'org.neo4j.kernel.StoreLockerLifecycleAdapter@fef4f5a' was successfully initialized, but failed to start. Please see attached cause exception.
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:513) ~[neo4j-kernel-2.2.5.jar:2.2.5]
at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:115) ~[neo4j-kernel-2.2.5.jar:2.2.5]
at org.neo4j.kernel.InternalAbstractGraphDatabase.run(InternalAbstractGraphDatabase.java:331) ~[neo4j-kernel-2.2.5.jar:2.2.5]
... 8 common frames omitted
Caused by: org.neo4j.kernel.StoreLockException: Unable to obtain lock on store lock file: /usr/local/neo4j-community-2.2.5/data/graph.db/store_lock. Please ensure no other process is using this database, and that the directory is writable (required even for read-only access)
at org.neo4j.kernel.StoreLocker.checkLock(StoreLocker.java:78) ~[neo4j-kernel-2.2.5.jar:2.2.5]
at org.neo4j.kernel.StoreLockerLifecycleAdapter.start(StoreLockerLifecycleAdapter.java:44) ~[neo4j-kernel-2.2.5.jar:2.2.5]
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:507) ~[neo4j-kernel-2.2.5.jar:2.2.5]
... 10 common frames omitted
Caused by: java.io.FileNotFoundException: /usr/local/neo4j-community-2.2.5/data/graph.db/store_lock (Permission denied)
at java.io.RandomAccessFile.open(Native Method) ~[na:1.7.0_25]
at java.io.RandomAccessFile.<init>(RandomAccessFile.java:233) ~[na:1.7.0_25]
at org.neo4j.io.fs.DefaultFileSystemAbstraction.open(DefaultFileSystemAbstraction.java:54) ~[neo4j-io-2.2.5.jar:2.2.5]
at org.neo4j.io.fs.DefaultFileSystemAbstraction.open(DefaultFileSystemAbstraction.java:45) ~[neo4j-io-2.2.5.jar:2.2.5]
at org.neo4j.kernel.StoreLocker.checkLock(StoreLocker.java:73) ~[neo4j-kernel-2.2.5.jar:2.2.5]
... 12 common frames omitted
答案 0 :(得分:2)
stackTrace很明确:
Caused by: org.neo4j.kernel.StoreLockException: Unable to obtain lock on store lock file: /usr/local/neo4j-community-2.2.5/data/graph.db/store_lock. Please ensure no other process is using this database, and that the directory is writable (required even for read-only access)
at org.neo4j.kernel.StoreLocker.checkLock(StoreLocker.java:78) ~[neo4j-kernel-2.2.5.jar:2.2.5]
at org.neo4j.kernel.StoreLockerLifecycleAdapter.start(StoreLockerLifecycleAdapter.java:44) ~[neo4j-kernel-2.2.5.jar:2.2.5]
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:507) ~[neo4j-kernel-2.2.5.jar:2.2.5]
... 10 common frames omitted
Caused by: java.io.FileNotFoundException: /usr/local/neo4j-community-2.2.5/data/graph.db/store_lock (Permission denied)
at java.io.RandomAccessFile.open(Native Method) ~[na:1.7.0_25]
at java.io.RandomAccessFile.<init>(RandomAccessFile.java:233) ~[na:1.7.0_25]
at org.neo4j.io.fs.DefaultFileSystemAbstraction.open(DefaultFileSystemAbstraction.java:54) ~[neo4j-io-2.2.5.jar:2.2.5]
at org.neo4j.io.fs.DefaultFileSystemAbstraction.open(DefaultFileSystemAbstraction.java:45) ~[neo4j-io-2.2.5.jar:2.2.5]
at org.neo4j.kernel.StoreLocker.checkLock(StoreLocker.java:73) ~[neo4j-kernel-2.2.5.jar:2.2.5]
... 12 common frames omitted
运行neo4j进程的用户对商店文件没有写入权限。
请注意,备份工具仅适用于企业版。您可以在使用社区时简单地复制商店文件。
答案 1 :(得分:1)
在Neo4j社区版中运行备份的唯一干净方法是关闭服务器,并复制掉data/graph.db
文件夹。
在数据库运行时进行复制可能会导致副本不一致。
Neo4j企业版具有neo4j-backup
作为在数据库运行时进行一致备份的功能。这还涉及对备份进行的详细一致性检查,以确保可恢复性。