我正在运行3个ZooKeeper实例,配置如下:
tickTime=2000 initLimit=10 syncLimit=5 dataDir=/tmp/zookeeper1 clientPort=2181 maxClientCnxns=1000 server.1=127.0.0.1:2888:3888 server.2=127.0.0.1:2889:3889 server.3=127.0.0.1:2890:3890
我正在使用此处给出的领导者选举示例代码:https: //git-wip-us.apache.org/repos/asf?p = curator.git; a = tree; f = curator-examples /src/main/java /前导; H = 73b547eadb98995c0ccbd06a5b76d0741ffef263; HB = HEAD
代码在TestingServer中运行良好但是当我将连接字符串更改为:时"127.0.0.1:2181,127.0.0.1:2182,127.0.0.1:2183"
,我得到了例外:
[main-SendThread(127.0.0.1:2183)] INFO org.apache.zookeeper.ClientCnxn - Opening socket connection to server 127.0.0.1/127.0.0.1:2183. Will not attempt to authenticate using SASL (unknown error) [main-SendThread(127.0.0.1:2183)] INFO org.apache.zookeeper.ClientCnxn - Socket connection established, initiating session, client: /127.0.0.1:56111, server: 127.0.0.1/127.0.0.1:2183 [main-SendThread(127.0.0.1:2183)] INFO org.apache.zookeeper.ClientCnxn - Session establishment complete on server 127.0.0.1/127.0.0.1:2183, sessionid = 0x3521552283c0000, negotiated timeout = 40000 [main-EventThread] INFO org.apache.curator.framework.state.ConnectionStateManager - State change: CONNECTED [main-SendThread(127.0.0.1:2183)] INFO org.apache.zookeeper.ClientCnxn - Unable to read additional data from server sessionid 0x3521552283c0000, likely server has closed socket, closing socket connection and attempting reconnect [main-EventThread] INFO org.apache.curator.framework.imps.EnsembleTracker - New config event received: null [main-EventThread] ERROR org.apache.curator.framework.imps.CuratorFrameworkImpl - Background exception was not retry-able or retry gave up java.lang.NullPointerException at java.io.ByteArrayInputStream.(ByteArrayInputStream.java:106) at org.apache.curator.framework.imps.EnsembleTracker.processConfigData(EnsembleTracker.java:163) at org.apache.curator.framework.imps.EnsembleTracker.access$200(EnsembleTracker.java:48) at org.apache.curator.framework.imps.EnsembleTracker$2.processResult(EnsembleTracker.java:134) at org.apache.curator.framework.imps.CuratorFrameworkImpl.sendToBackgroundCallback(CuratorFrameworkImpl.java:829) at org.apache.curator.framework.imps.CuratorFrameworkImpl.processBackgroundOperation(CuratorFrameworkImpl.java:611) at org.apache.curator.framework.imps.WatcherRemovalFacade.processBackgroundOperation(WatcherRemovalFacade.java:151) at org.apache.curator.framework.imps.GetConfigBuilderImpl$2.processResult(GetConfigBuilderImpl.java:210) at org.apache.zookeeper.ClientCnxn$EventThread.processEvent(ClientCnxn.java:619) at org.apache.zookeeper.ClientCnxn$EventThread.run(ClientCnxn.java:528) [main-EventThread] INFO org.apache.curator.framework.state.ConnectionStateManager - State change: SUSPENDED
可能是什么问题?