Neo4J服务器异常-无法启动 [英] Neo4J server exception - fails to start

查看:137
本文介绍了Neo4J服务器异常-无法启动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

服务器一直运行良好,但突然停止了运行.尝试重新启动,但这没有帮助.这就是日志所说的:

The server had been running fine and dandy but suddenly stopped. Tried restarting but that didn't help. This is what the log says:

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分钟:

Acted upon the advice given in the answer but unfortunately the server still doesn't start. neo4j start command has been waiting for server to start for the last 10 minutes:

使用其他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] ...正在等待 服务器准备就绪.........

Using additional JVM arguments: -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 Starting Neo4j Server...WARNING: not changing user process [29578]... waiting for server to be ready.........

日志文件显示:

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

我的服务器以前有大约5万个节点和30万个关系.服务器是否正在尝试恢复数据,从而导致启动延迟?

My server previously had around 50K nodes and 300K relationships. Is the server attempting to recover the data, and hence causing the delay in starting?

推荐答案

错误消息

 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这样的常见可疑对象来检查运行的进程.

is pretty much self speaking. You either don't have the file system permission to access your graph.db folder or (which I think is more probable) that there is still another Neo4j process running on the same graph.db directory. You can check for running processes using the usual suspects like jps or ps aux | grep java.

这篇关于Neo4J服务器异常-无法启动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆