Neo4J服务器异常 - 无法启动

时间:2015-02-18 15:17:35

标签: neo4j

服务器运行良好,花花公子但突然停了下来。尝试重新启动,但没有帮助。这就是日志所说的:

2015-02-18 15:07:58.092+0000 INFO  [o.n.k.i.DiagnosticsManager]: --- SHUTDOWN diagnostics END ---
2015-02-18 15:07:58.336+0000 ERROR [o.n.s.CommunityBootstrapper]: Failed to start Neo Server on port [7474]
org.neo4j.server.ServerStartupException: Starting Neo4j Server failed: Error starting org.neo4j.kernel.EmbeddedGraphDatabase, /var/lib/neo4j-community-2.1.4/data/graph.db
        at org.neo4j.server.AbstractNeoServer.start(AbstractNeoServer.java:226) ~[neo4j-server-2.1.4.jar:2.1.4]
        at org.neo4j.server.Bootstrapper.start(Bootstrapper.java:108) [neo4j-server-2.1.4.jar:2.1.4]
        at org.neo4j.server.Bootstrapper.main(Bootstrapper.java:62) [neo4j-server-2.1.4.jar:2.1.4]
Caused by: java.lang.RuntimeException: Error starting org.neo4j.kernel.EmbeddedGraphDatabase, /var/lib/neo4j-community-2.1.4/data/graph.db
        at org.neo4j.kernel.InternalAbstractGraphDatabase.run(InternalAbstractGraphDatabase.java:366) ~[neo4j-kernel-2.1.4.jar:2.1.4]
        at org.neo4j.kernel.EmbeddedGraphDatabase.<init>(EmbeddedGraphDatabase.java:59) ~[neo4j-kernel-2.1.4.jar:2.1.4]
        at org.neo4j.kernel.impl.recovery.StoreRecoverer.recover(StoreRecoverer.java:123) ~[neo4j-kernel-2.1.4.jar:2.1.4]
        at org.neo4j.server.preflight.PerformRecoveryIfNecessary.run(PerformRecoveryIfNecessary.java:65) ~[neo4j-server-2.1.4.jar:2.1.4]
        at org.neo4j.server.preflight.PreFlightTasks.run(PreFlightTasks.java:71) ~[neo4j-server-2.1.4.jar:2.1.4]
        at org.neo4j.server.AbstractNeoServer.runPreflightTasks(AbstractNeoServer.java:362) ~[neo4j-server-2.1.4.jar:2.1.4]
        at org.neo4j.server.AbstractNeoServer.start(AbstractNeoServer.java:159) ~[neo4j-server-2.1.4.jar:2.1.4]
        ... 2 common frames omitted
Caused by: org.neo4j.kernel.lifecycle.LifecycleException: Component 'org.neo4j.kernel.StoreLockerLifecycleAdapter@7bd760a1' 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.1.4.jar:2.1.4]
        at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:115) ~[neo4j-kernel-2.1.4.jar:2.1.4]
        at org.neo4j.kernel.InternalAbstractGraphDatabase.run(InternalAbstractGraphDatabase.java:343) ~[neo4j-kernel-2.1.4.jar:2.1.4]
        ... 8 common frames omitted
Caused by: org.neo4j.kernel.StoreLockException: Unable to obtain lock on store lock file: /var/lib/neo4j-community-2.1.4/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:82) ~[neo4j-kernel-2.1.4.jar:2.1.4]
        at org.neo4j.kernel.StoreLockerLifecycleAdapter.start(StoreLockerLifecycleAdapter.java:44) ~[neo4j-kernel-2.1.4.jar:2.1.4]
        at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:507) ~[neo4j-kernel-2.1.4.jar:2.1.4]
        ... 10 common frames omitted
Caused by: java.io.IOException: Unable to lock org.neo4j.kernel.impl.nioneo.store.StoreFileChannel@c8925d7
        at org.neo4j.kernel.impl.nioneo.store.FileLock.wrapFileChannelLock(FileLock.java:38) ~[neo4j-kernel-2.1.4.jar:2.1.4]
        at org.neo4j.kernel.impl.nioneo.store.FileLock.getOsSpecificFileLock(FileLock.java:93) ~[neo4j-kernel-2.1.4.jar:2.1.4]
        at org.neo4j.kernel.DefaultFileSystemAbstraction.tryLock(DefaultFileSystemAbstraction.java:93) ~[neo4j-kernel-2.1.4.jar:2.1.4]
        at org.neo4j.kernel.StoreLocker.checkLock(StoreLocker.java:74) ~[neo4j-kernel-2.1.4.jar:2.1.4]
        ... 12 common frames omitted

更新

根据答案中给出的建议行事,但遗憾的是服务器仍然无法启动。 neo4j start命令一直在等待服务器在最后10分钟内启动:

  

使用其他JVM参数:-server -XX:+ DisableExplicitGC   -Dorg.neo4j.server.properties = conf / neo4j-server.properties -Djava.util.logging.config.file = conf / logging.properties -Dlog4j.configuration = file:conf / log4j.properties -XX:+ UseConcMarkSweepGC - XX:+ CMSClassUnloadingEnabled启动Neo4j服务器...警告:不更改用户进程[29578] ...等待   服务器准备.........

日志文件说:

2015-02-18 15:50:09.958+0000 INFO  [o.n.k.i.t.x.XaLogicalLog]: [/var/lib/neo4j-community-2.1.4/data/graph.db/nioneo_logical.log.1] entries found=91485 lastEntryPos=5328191
2015-02-18 15:50:09.958+0000 INFO  [o.n.k.i.t.x.XaLogicalLog]: Opened logical log [/var/lib/neo4j-community-2.1.4/data/graph.db/nioneo_logical.log.1] version=8, lastTxId=513504 (recovered)
2015-02-18 15:50:09.959+0000 INFO  [o.n.k.i.t.x.XaLogicalLog]: XaResourceManager[nioneo_logical.log] sorting 0 xids
2015-02-18 15:50:09.997+0000 INFO  [o.n.k.i.t.x.XaLogicalLog]: XaResourceManager[nioneo_logical.log] checkRecoveryComplete 0 xids
2015-02-18 15:50:10.407+0000 INFO  [o.n.k.i.n.s.StoreFactory]: /var/lib/neo4j-community-2.1.4/data/graph.db/neostore.relationshiptypestore.db.names rebuild id generator, highId=35 defragged count=0
2015-02-18 15:50:10.490+0000 INFO  [o.n.k.i.n.s.StoreFactory]: /var/lib/neo4j-community-2.1.4/data/graph.db/neostore.labeltokenstore.db.names rebuild id generator, highId=17 defragged count=0
2015-02-18 15:50:10.571+0000 INFO  [o.n.k.i.n.s.StoreFactory]: /var/lib/neo4j-community-2.1.4/data/graph.db/neostore.labeltokenstore.db rebuild id generator, highId=16 defragged count=0
2015-02-18 15:50:10.653+0000 INFO  [o.n.k.i.n.s.StoreFactory]: /var/lib/neo4j-community-2.1.4/data/graph.db/neostore.propertystore.db.index.keys rebuild id generator, highId=49 defragged count=0
2015-02-18 15:50:10.776+0000 INFO  [o.n.k.i.n.s.StoreFactory]: /var/lib/neo4j-community-2.1.4/data/graph.db/neostore.propertystore.db.index rebuild id generator, highId=44 defragged count=0
2015-02-18 15:50:10.819+0000 INFO  [o.n.k.i.n.s.StoreFactory]: /var/lib/neo4j-community-2.1.4/data/graph.db/neostore.propertystore.db.strings rebuild id generator, highId=41 defragged count=0
2015-02-18 15:50:11.101+0000 INFO  [o.n.k.i.n.s.StoreFactory]: /var/lib/neo4j-community-2.1.4/data/graph.db/neostore.propertystore.db.arrays rebuild id generator, highId=7954 defragged count=0
2015-02-18 15:50:15.753+0000 INFO  [o.n.k.i.n.s.StoreFactory]: /var/lib/neo4j-community-2.1.4/data/graph.db/neostore.propertystore.db rebuild id generator, highId=212690 defragged count=0
2015-02-18 15:50:19.113+0000 INFO  [o.n.k.i.n.s.StoreFactory]: /var/lib/neo4j-community-2.1.4/data/graph.db/neostore.relationshipstore.db rebuild id generator, highId=234591 defragged count=0
2015-02-18 15:50:19.155+0000 INFO  [o.n.k.i.n.s.StoreFactory]: /var/lib/neo4j-community-2.1.4/data/graph.db/neostore.nodestore.db.labels rebuild id generator, highId=1 defragged count=0
2015-02-18 15:50:20.131+0000 INFO  [o.n.k.i.n.s.StoreFactory]: /var/lib/neo4j-community-2.1.4/data/graph.db/neostore.nodestore.db rebuild id generator, highId=46820 defragged count=0
2015-02-18 15:50:20.194+0000 INFO  [o.n.k.i.n.s.StoreFactory]: /var/lib/neo4j-community-2.1.4/data/graph.db/neostore.schemastore.db rebuild id generator, highId=5 defragged count=0
2015-02-18 15:50:20.300+0000 INFO  [o.n.k.i.n.s.StoreFactory]: /var/lib/neo4j-community-2.1.4/data/graph.db/neostore.relationshipgroupstore.db rebuild id generator, highId=14508 defragged count=0
2015-02-18 15:50:20.423+0000 INFO  [o.n.k.i.n.s.StoreFactory]: /var/lib/neo4j-community-2.1.4/data/graph.db/neostore rebuild id generator, highId=9 defragged count=0
2015-02-18 15:50:20.424+0000 INFO  [o.n.k.i.t.x.XaLogicalLog]: XaResourceManager[nioneo_logical.log] recovery completed.
2015-02-18 15:50:20.424+0000 INFO  [o.n.k.i.t.x.XaLogicalLog]: Recovery on log [/var/lib/neo4j-community-2.1.4/data/graph.db/nioneo_logical.log.1] completed.
2015-02-18 15:50:20.628+0000 INFO  [o.n.k.i.t.TxManager]: TM opening log: /var/lib/neo4j-community-2.1.4/data/graph.db/tm_tx_log.2
2015-02-18 15:50:20.992+0000 INFO  [o.n.k.i.t.x.XaLogicalLog]: Non clean shutdown detected on log [/var/lib/neo4j-community-2.1.4/data/graph.db/index/lucene.log.1]. Recovery started ...
2015-02-18 15:50:20.992+0000 INFO  [o.n.k.i.t.x.XaLogicalLog]: [/var/lib/neo4j-community-2.1.4/data/graph.db/index/lucene.log.1] logVersion=2 with committed tx=199234

我的服务器以前有大约50K节点和300K关系。服务器是否尝试恢复数据,从而导致启动延迟?

2 个答案:

答案 0 :(得分:4)

错误消息

 org.neo4j.kernel.StoreLockException: Unable to obtain lock on store lock file: /var/lib/neo4j-community-2.1.4/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)

非常自我说话。您要么没有文件系统权限来访问您的graph.db文件夹,要么(我认为更有可能)在同一graph.db目录上还有另一个Neo4j进程正在运行。您可以使用jpsps aux | grep java等常见嫌疑人检查正在运行的流程。

答案 1 :(得分:1)

我对消息无法在商店锁定文件(...)上获得锁定

有相同的问题

发生了什么事?当我以sudo身份设置graph.db时,所有者显然是root / root。 Neo4j进程不允许访问该地方。

对我有用的解决方案是使用以下方法更改graph.db文件夹的所有者:

chown -R neo4j.neo4j /path/to/graphdb/graph.db/