简体   繁体   English

Neo4j群集-Neo4j节点启动时“ UnableToSampleException”,该节点在崩溃之前是主节点

[英]Neo4j cluster - “UnableToSampleException” when neo4j node starts, that was master before crash

I have cluster of 3 neo4j databases. 我有3个neo4j数据库集群。 Node1 - master. 节点1-主节点。 Node2 - slave. 节点2-从属。 Node3 - slave. Node3-从属。

Node1 crashes for some reason. 由于某种原因,Node1崩溃。 After short time cluster detects that and elect new master. 短时间后,群集检测到该情况并选出新的主机。 So, now we have: Node1 - ? 因此,现在我们有了:Node1-? Node2 - master Node3 - slave Node2-主节点Node3-从节点

When I boot up Node1, it: 当我启动Node1时,它:

  • Joins cluster 加入集群
  • Then gets new database version from master (store, than log files) 然后从主服务器获取新的数据库版本(存储而不是日志文件)
  • Then it stucks at org.neo4j.server.rrd.UnableToSampleException error. 然后卡在org.neo4j.server.rrd.UnableToSampleException错误中。

Stacktrace: 堆栈跟踪:

org.neo4j.server.rrd.UnableToSampleException
    at org.neo4j.server.rrd.sampler.NodeIdsInUseSampleable.getValue(NodeIdsInUseSampleable.java:47)
    at org.neo4j.server.rrd.RrdSamplerImpl.updateSample(RrdSamplerImpl.java:59)
    at org.neo4j.server.rrd.RrdJob.run(RrdJob.java:43)
    at org.neo4j.server.rrd.ScheduledJob$1.run(ScheduledJob.java:41)
    at java.util.TimerThread.mainLoop(Timer.java:555)
    at java.util.TimerThread.run(Timer.java:505)

Logs: 日志:

2014-11-13 12:11:50.147+0000 INFO  [Cluster] Checking store consistency with master
2014-11-13 12:11:50.853+0000 INFO  [Cluster] The store is inconsistent. Will treat it as branched and fetch a new one from the master
2014-11-13 12:11:52.030+0000 INFO  [Cluster] Copying store from master
... copying store
... copying schema
... copying logs
2014-11-13 12:13:57.768+0000 INFO  [API] Server started on: http://0.0.0.0:7474/
// it starts server, while logs download is in progress
... org.neo4j.server.rrd.UnableToSampleException error loop

  • Sometimes error loop stops after some time (10-15 min) and server starts normally. 有时,错误循环会在一段时间(10-15分钟)后停止,服务器会正​​常启动。
  • If I restart neo4j again, everything works normally. 如果我重新启动neo4j,一切正常。

Any ideas, what this can be? 任何想法,这可能是什么?

The root exception is not being logged. 根异常未记录。 You have to debug the NodeIdsInUseSampleable class. 您必须调试NodeIdsInUseSampleable类。 In my case i got the following exception: 就我而言,我遇到以下异常:

java.lang.IllegalStateException: XaDataSourceManager has been shut down.
    at org.neo4j.kernel.impl.transaction.XaDataSourceManager.getXaDataSource(XaDataSourceManager.java:211)
    at org.neo4j.kernel.impl.transaction.XaDataSourceManager.getNeoStoreDataSource(XaDataSourceManager.java:225)
    at org.neo4j.kernel.impl.nioneo.xa.NioNeoDbPersistenceSource.getNumberOfIdsInUse(NioNeoDbPersistenceSource.java:72)
    at org.neo4j.kernel.impl.core.NodeManager.getNumberOfIdsInUse(NodeManager.java:689)
    at org.neo4j.server.rrd.sampler.NodeIdsInUseSampleable.getValue(NodeIdsInUseSampleable.java:43)
    at org.neo4j.server.rrd.RrdSamplerImpl.updateSample(RrdSamplerImpl.java:59)
    at org.neo4j.server.rrd.RrdJob.run(RrdJob.java:43)
    at org.neo4j.server.rrd.ScheduledJob$1.run(ScheduledJob.java:41)
    at java.util.TimerThread.mainLoop(Timer.java:555)
    at java.util.TimerThread.run(Timer.java:505)

In my case the exception occurred since shutdown was invoked. 以我为例,自从调用shutdown以来发生了异常。 I assume this might be the same for you. 我认为这对您来说可能是一样的。 You just have to determine who is calling shutdown. 您只需确定谁正在调用关机。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM