我在 HA 模式下遇到了 Neo4j 1.9.1 的一些问题。
目前,graph.db 目录中的 messages.log 有很多这样的错误:
2013-07-12 12:08:26.323+0000 ERROR [o.n.k.h.c.m.MasterServer]: Error handling request
org.neo4j.com.ComException: org.neo4j.kernel.ha.BranchedDataException: txId:455631, masterId:1, checksum:169458400216 doesn't match (1, 163582912318)
at org.neo4j.kernel.ha.BranchDetectingTxVerifier.assertMatch(BranchDetectingTxVerifier.java:60) ~[neo4j-ha-1.9.1.jar:1.9.1]
at org.neo4j.com.Server.readContext(Server.java:668) ~[neo4j-com-1.9.1.jar:1.9.1]
at org.neo4j.com.Server.handleRequest(Server.java:498) ~[neo4j-com-1.9.1.jar:1.9.1]
at org.neo4j.com.Server$ServerHandler.messageReceived(Server.java:315) ~[neo4j-com-1.9.1.jar:1.9.1]
at org.jboss.netty.channel.SimpleChannelHandler.handleUpstream(SimpleChannelHandler.java:88) [netty-3.6.3.Final.jar:na]
at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:560) [netty-3.6.3.Final.jar:na]
at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:787) [netty-3.6.3.Final.jar:na]
at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:296) [netty-3.6.3.Final.jar:na]
at org.jboss.netty.handler.codec.frame.FrameDecoder.unfoldAndFireMessageReceived(FrameDecoder.java:462) [netty-3.6.3.Final.jar:na]
at org.jboss.netty.handler.codec.frame.FrameDecoder.callDecode(FrameDecoder.java:443) [netty-3.6.3.Final.jar:na]
at org.jboss.netty.handler.codec.frame.FrameDecoder.messageReceived(FrameDecoder.java:303) [netty-3.6.3.Final.jar:na]
at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70) [netty-3.6.3.Final.jar:na]
at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:560) [netty-3.6.3.Final.jar:na]
at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:555) [netty-3.6.3.Final.jar:na]
at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:268) [netty-3.6.3.Final.jar:na]
at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:255) [netty-3.6.3.Final.jar:na]
at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:88) [netty-3.6.3.Final.jar:na]
at org.jboss.netty.channel.socket.nio.AbstractNioWorker.process(AbstractNioWorker.java:107) [netty-3.6.3.Final.jar:na]
at org.jboss.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:312) [netty-3.6.3.Final.jar:na]
at org.jboss.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:88) [netty-3.6.3.Final.jar:na]
at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:178) [netty-3.6.3.Final.jar:na]
at org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108) [netty-3.6.3.Final.jar:na]
at org.jboss.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42) [netty-3.6.3.Final.jar:na]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [na:1.7.0_21]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [na:1.7.0_21]
at java.lang.Thread.run(Unknown Source) [na:1.7.0_21]
Caused by: org.neo4j.kernel.ha.BranchedDataException: txId:455631, masterId:1, checksum:169458400216 doesn't match (1, 163582912318)
... 26 common frames omitted
2013-07-12 12:08:26.323+0000 WARN [o.n.k.h.c.m.MasterServer]: Exception from Netty
org.neo4j.com.ComException: org.neo4j.kernel.ha.BranchedDataException: txId:455631, masterId:1, checksum:169458400216 doesn't match (1, 163582912318)
at org.neo4j.kernel.ha.BranchDetectingTxVerifier.assertMatch(BranchDetectingTxVerifier.java:60) ~[neo4j-ha-1.9.1.jar:1.9.1]
at org.neo4j.com.Server.readContext(Server.java:668) ~[neo4j-com-1.9.1.jar:1.9.1]
at org.neo4j.com.Server.handleRequest(Server.java:498) ~[neo4j-com-1.9.1.jar:1.9.1]
at org.neo4j.com.Server$ServerHandler.messageReceived(Server.java:315) ~[neo4j-com-1.9.1.jar:1.9.1]
at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:296) ~[netty-3.6.3.Final.jar:na]
at org.jboss.netty.handler.codec.frame.FrameDecoder.unfoldAndFireMessageReceived(FrameDecoder.java:462) ~[netty-3.6.3.Final.jar:na]
at org.jboss.netty.handler.codec.frame.FrameDecoder.callDecode(FrameDecoder.java:443) ~[netty-3.6.3.Final.jar:na]
at org.jboss.netty.handler.codec.frame.FrameDecoder.messageReceived(FrameDecoder.java:303) ~[netty-3.6.3.Final.jar:na]
at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:268) ~[netty-3.6.3.Final.jar:na]
at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:255) ~[netty-3.6.3.Final.jar:na]
at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:88) ~[netty-3.6.3.Final.jar:na]
at org.jboss.netty.channel.socket.nio.AbstractNioWorker.process(AbstractNioWorker.java:107) ~[netty-3.6.3.Final.jar:na]
at org.jboss.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:312) ~[netty-3.6.3.Final.jar:na]
at org.jboss.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:88) ~[netty-3.6.3.Final.jar:na]
at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:178) ~[netty-3.6.3.Final.jar:na]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [na:1.7.0_21]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [na:1.7.0_21]
at java.lang.Thread.run(Unknown Source) [na:1.7.0_21]
Caused by: org.neo4j.kernel.ha.BranchedDataException: txId:455631, masterId:1, checksum:169458400216 doesn't match (1, 163582912318)
... 18 common frames omitted
2013-07-12 12:08:26.326+0000 ERROR [o.n.k.h.HighlyAvailableGraphDatabase]: Slave commit threw communication exception
java.util.concurrent.ExecutionException: org.neo4j.com.ComException: Channel has been closed
at java.util.concurrent.FutureTask$Sync.innerGet(Unknown Source) ~[na:1.7.0_21]
at java.util.concurrent.FutureTask.get(Unknown Source) ~[na:1.7.0_21]
at org.neo4j.kernel.ha.transaction.MasterTxIdGenerator.isSuccessful(MasterTxIdGenerator.java:292) [neo4j-ha-1.9.1.jar:1.9.1]
at org.neo4j.kernel.ha.transaction.MasterTxIdGenerator.committed(MasterTxIdGenerator.java:221) [neo4j-ha-1.9.1.jar:1.9.1]
at sun.reflect.GeneratedMethodAccessor79.invoke(Unknown Source) ~[na:na]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:1.7.0_21]
at java.lang.reflect.Method.invoke(Unknown Source) ~[na:1.7.0_21]
at org.neo4j.kernel.ha.DelegateInvocationHandler.invoke(DelegateInvocationHandler.java:53) [neo4j-ha-1.9.1.jar:1.9.1]
at com.sun.proxy.$Proxy14.committed(Unknown Source) [na:na]
at org.neo4j.kernel.impl.transaction.xaframework.XaResourceManager.commit(XaResourceManager.java:511) [neo4j-kernel-1.9.1.jar:1.9.1]
at org.neo4j.kernel.impl.transaction.xaframework.XaResourceHelpImpl.commit(XaResourceHelpImpl.java:64) [neo4j-kernel-1.9.1.jar:1.9.1]
at org.neo4j.kernel.impl.transaction.TransactionImpl.doCommit(TransactionImpl.java:570) [neo4j-kernel-1.9.1.jar:1.9.1]
at org.neo4j.kernel.impl.transaction.TxManager.commit(TxManager.java:394) [neo4j-kernel-1.9.1.jar:1.9.1]
at org.neo4j.kernel.impl.transaction.TxManager.commit(TxManager.java:344) [neo4j-kernel-1.9.1.jar:1.9.1]
at org.neo4j.kernel.impl.transaction.TransactionImpl.commit(TransactionImpl.java:134) [neo4j-kernel-1.9.1.jar:1.9.1]
at org.neo4j.kernel.TopLevelTransaction.finish(TopLevelTransaction.java:127) [neo4j-kernel-1.9.1.jar:1.9.1]
at org.neo4j.server.rest.web.BatchOperationService.batchProcess(BatchOperationService.java:131) [neo4j-server-1.9.1.jar:1.9.1]
at org.neo4j.server.rest.web.BatchOperationService.performBatchOperations(BatchOperationService.java:71) [neo4j-server-1.9.1.jar:1.9.1]
at sun.reflect.GeneratedMethodAccessor73.invoke(Unknown Source) ~[na:na]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:1.7.0_21]
at java.lang.reflect.Method.invoke(Unknown Source) ~[na:1.7.0_21]
at com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60) [jersey-server-1.9.jar:1.9]
at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$ResponseOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:205) [jersey-server-1.9.jar:1.9]
at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75) [jersey-server-1.9.jar:1.9]
at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:288) [jersey-server-1.9.jar:1.9]
at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108) [jersey-server-1.9.jar:1.9]
at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147) [jersey-server-1.9.jar:1.9]
at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84) [jersey-server-1.9.jar:1.9]
at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1469) [jersey-server-1.9.jar:1.9]
at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1400) [jersey-server-1.9.jar:1.9]
at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1349) [jersey-server-1.9.jar:1.9]
at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1339) [jersey-server-1.9.jar:1.9]
at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:416) [jersey-server-1.9.jar:1.9]
at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:537) [jersey-server-1.9.jar:1.9]
at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:699) [jersey-server-1.9.jar:1.9]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) [servlet-api-2.5-20081211.jar:na]
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511) [jetty-6.1.25.jar:6.1.25]
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166) [jetty-6.1.25.jar:6.1.25]
at org.neo4j.server.rest.security.SecurityFilter.doFilter(SecurityFilter.java:112) [neo4j-server-1.9.1.jar:1.9.1]
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157) [jetty-6.1.25.jar:6.1.25]
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388) [jetty-6.1.25.jar:6.1.25]
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182) [jetty-6.1.25.jar:6.1.25]
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765) [jetty-6.1.25.jar:6.1.25]
at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114) [jetty-6.1.25.jar:6.1.25]
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) [jetty-6.1.25.jar:6.1.25]
at org.mortbay.jetty.Server.handle(Server.java:326) [jetty-6.1.25.jar:6.1.25]
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542) [jetty-6.1.25.jar:6.1.25]
at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:943) [jetty-6.1.25.jar:6.1.25]
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756) [jetty-6.1.25.jar:6.1.25]
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218) [jetty-6.1.25.jar:6.1.25]
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404) [jetty-6.1.25.jar:6.1.25]
at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:410) [jetty-6.1.25.jar:6.1.25]
at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582) [jetty-util-6.1.25.jar:6.1.25]
org.neo4j.com.ComException: Channel has been closed
at org.neo4j.com.DechunkingChannelBuffer.readNext(DechunkingChannelBuffer.java:69) ~[neo4j-com-1.9.1.jar:1.9.1]
at org.neo4j.com.DechunkingChannelBuffer.readNextChunk(DechunkingChannelBuffer.java:93) ~[neo4j-com-1.9.1.jar:1.9.1]
at org.neo4j.com.DechunkingChannelBuffer.<init>(DechunkingChannelBuffer.java:59) ~[neo4j-com-1.9.1.jar:1.9.1]
at org.neo4j.com.Client.sendRequest(Client.java:226) ~[neo4j-com-1.9.1.jar:1.9.1]
at org.neo4j.com.Client.sendRequest(Client.java:200) ~[neo4j-com-1.9.1.jar:1.9.1]
at org.neo4j.kernel.ha.com.slave.MasterClient18.pullUpdates(MasterClient18.java:284) ~[neo4j-ha-1.9.1.jar:1.9.1]
at org.neo4j.kernel.ha.com.slave.SlaveImpl.pullUpdates(SlaveImpl.java:50) ~[neo4j-ha-1.9.1.jar:1.9.1]
at org.neo4j.kernel.ha.com.master.SlaveClient$SlaveRequestType$1.call(SlaveClient.java:80) ~[neo4j-ha-1.9.1.jar:1.9.1]
at org.neo4j.kernel.ha.com.master.SlaveClient$SlaveRequestType$1.call(SlaveClient.java:75) ~[neo4j-ha-1.9.1.jar:1.9.1]
at org.neo4j.com.Server$4.run(Server.java:559) ~[neo4j-com-1.9.1.jar:1.9.1]
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) ~[na:1.7.0_21]
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) ~[na:1.7.0_21]
at java.util.concurrent.FutureTask.run(Unknown Source) ~[na:1.7.0_21]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) ~[na:1.7.0_21]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) ~[na:1.7.0_21]
at java.lang.Thread.run(Unknown Source) ~[na:1.7.0_21]
2013-07-12 12:08:26.326+0000 DEBUG [o.n.k.h.HighlyAvailableGraphDatabase]: Transaction 741991 for nioneodb couldn't commit on enough slaves, desired 1, but could only commit at 0
2013-07-12 12:08:26.371+0000 DEBUG [o.n.k.h.c.m.SlaveClient]: Opened a new channel to /172.16.0.132:6001
2013-07-12 12:08:26.371+0000 DEBUG [o.n.k.h.c.m.SlaveClient]: ResourcePool create resource ([id: 0x7619280f, /172.16.0.131:47865 => /172.16.0.132:6001], DynamicChannelBuffer(ridx=0, widx=0, cap=256), java.nio.HeapByteBuffer[pos=0 lim=1048576 cap=1048576])
我找不到任何原因,我不知道如何阻止这种行为。有没有人可以帮助我?
编辑:另外,我在从服务器上有这个日志:
2013-07-12 15:44:11.019+0000 WARN [o.n.k.h.c.s.SlaveServer]: Exception from Netty
java.lang.NullPointerException: null
at org.neo4j.com.Server$ServerHandler.writeComplete(Server.java:337) ~[neo4j-com-1.9.1.jar:1.9.1]
at org.jboss.netty.channel.Channels.fireWriteComplete(Channels.java:324) ~[netty-3.6.3.Final.jar:na]
at org.jboss.netty.channel.socket.nio.AbstractNioWorker.write0(AbstractNioWorker.java:275) ~[netty-3.6.3.Final.jar:na]
at org.jboss.netty.channel.socket.nio.AbstractNioWorker.writeFromTaskLoop(AbstractNioWorker.java:150) ~[netty-3.6.3.Final.jar:na]
at org.jboss.netty.channel.socket.nio.AbstractNioChannel$WriteTask.run(AbstractNioChannel.java:335) ~[netty-3.6.3.Final.jar:na]
at org.jboss.netty.channel.socket.nio.AbstractNioSelector.processTaskQueue(AbstractNioSelector.java:366) ~[netty-3.6.3.Final.jar:na]
at org.jboss.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:290) ~[netty-3.6.3.Final.jar:na]
at org.jboss.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:88) ~[netty-3.6.3.Final.jar:na]
at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:178) ~[netty-3.6.3.Final.jar:na]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [na:1.7.0_21]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [na:1.7.0_21]
at java.lang.Thread.run(Unknown Source) [na:1.7.0_21]
该日志每 50 毫秒写入一次。
但显然,HA 似乎正在工作。所以我不明白为什么我一直有这些日志。
提前感谢任何可以向我解释的人。纪尧姆