Unable to read additional data from server sessionid 0x0


今天在本機安裝了三個zookeeper,分別為server1,server2,server3。

tickTime=2000

initLimit=5  

syncLimit=2  

dataDir=/Users/google/Work/Program/zookeeper/server1/zookeeper-3.4.6/data

dataLogDir=/Users/google/Work/Program/zookeeper/server1/zookeeper-3.4.6/logs

clientPort=4080  

server.1=127.0.0.1:9991:7770  

server.2=127.0.0.1:9992:7771  

server.3=127.0.0.1:9993:7772  

然后啟動了server3的zkServer.sh,用server1的zkCli.sh去連接,結果報了如下錯誤:

2015-05-25 18:06:21,667 [myid:] - INFO  [main-SendThread(127.0.0.1:4083):ClientCnxn$SendThread@975] - Opening socket connection to server 127.0.0.1/127.0.0.1:4083. Will not attempt to authenticate using SASL (java.lang.SecurityException: ?޷???λ??¼????)
JLine support is enabled
2015-05-25 18:06:21,678 [myid:] - INFO  [main-SendThread(127.0.0.1:4083):ClientCnxn$SendThread@852] - Socket connection established to 127.0.0.1/127.0.0.1:4083, initiating session
2015-05-25 18:06:21,690 [myid:] - INFO  [main-SendThread(127.0.0.1:4083):ClientCnxn$SendThread@1098] - Unable to read additional data from server sessionid 0x0, likely server has closed socket, closing socket connection and attempting reconnect
[zk: 127.0.0.1:4083(CONNECTING) 0] 2015-05-25 18:06:23,045 [myid:] - INFO  [main-SendThread(127.0.0.1:4083):ClientCnxn$SendThread@975] - Opening socket connection to server 127.0.0.1/127.0.0.1:4083. Will not attempt to authenticate using SASL (java.lang.SecurityException: ?޷???λ??¼????)
2015-05-25 18:06:23,047 [myid:] - INFO  [main-SendThread(127.0.0.1:4083):ClientCnxn$SendThread@852] - Socket connection established to 127.0.0.1/127.0.0.1:4083, initiating session
2015-05-25 18:06:23,048 [myid:] - INFO  [main-SendThread(127.0.0.1:4083):ClientCnxn$SendThread@1098] - Unable to read additional data from server sessionid 0x0, likely server has closed socket, closing socket connection and attempting reconnect
2015-05-25 18:06:24,521 [myid:] - INFO  [main-SendThread(127.0.0.1:4083):ClientCnxn$SendThread@975] - Opening socket connection to server 127.0.0.1/127.0.0.1:4083. Will not attempt to authenticate using SASL (java.lang.SecurityException: ?޷???λ??¼????)
2015-05-25 18:06:24,522 [myid:] - INFO  [main-SendThread(127.0.0.1:4083):ClientCnxn$SendThread@852] - Socket connection established to 127.0.0.1/127.0.0.1:4083, initiating session
2015-05-25 18:06:24,523 [myid:] - INFO  [main-SendThread(127.0.0.1:4083):ClientCnxn$SendThread@1098] - Unable to read additional data from server sessionid 0x0, likely server has closed socket, closing socket connection and attempting reconnect
2015-05-25 18:06:25,942 [myid:] - INFO  [main-SendThread(127.0.0.1:4083):ClientCnxn$SendThread@975] - Opening socket connection to server 127.0.0.1/127.0.0.1:4083. Will not attempt to authenticate using SASL (java.lang.SecurityException: ?޷???λ??¼????)
2015-05-25 18:06:25,943 [myid:] - INFO  [main-SendThread(127.0.0.1:4083):ClientCnxn$SendThread@852] - Socket connection established to 127.0.0.1/127.0.0.1:4083, initiating session
2015-05-25 18:06:25,944 [myid:] - INFO  [main-SendThread(127.0.0.1:4083):ClientCnxn$SendThread@1098] - Unable to read additional data from server sessionid 0x0, likely server has closed socket, closing socket connection and attempting reconnect
2015-05-25 18:06:27,717 [myid:] - INFO  [main-SendThread(127.0.0.1:4083):ClientCnxn$SendThread@975] - Opening socket connection to server 127.0.0.1/127.0.0.1:4083. Will not attempt to authenticate using SASL (java.lang.SecurityException: ?޷???λ??¼????)
2015-05-25 18:06:27,717 [myid:] - INFO  [main-SendThread(127.0.0.1:4083):ClientCnxn$SendThread@852] - Socket connection established to 127.0.0.1/127.0.0.1:4083, initiating session
2015-05-25 18:06:27,718 [myid:] - INFO  [main-SendThread(127.0.0.1:4083):ClientCnxn$SendThread@1098] - Unable to read additional data from server sessionid 0x0, likely server has closed socket, closing socket connection and attempting reconnect
2015-05-25 18:06:29,608 [myid:] - INFO  [main-SendThread(127.0.0.1:4083):ClientCnxn$SendThread@975] - Opening socket connection to server 127.0.0.1/127.0.0.1:4083. Will not attempt to authenticate using SASL (java.lang.SecurityException: ?޷???λ??¼????)
2015-05-25 18:06:29,609 [myid:] - INFO  [main-SendThread(127.0.0.1:4083):ClientCnxn$SendThread@852] - Socket connection established to 127.0.0.1/127.0.0.1:4083, initiating session
2015-05-25 18:06:29,610 [myid:] - INFO  [main-SendThread(127.0.0.1:4083):ClientCnxn$SendThread@1098] - Unable to read additional data from server sessionid 0x0, likely server has closed socket, closing socket connection and attempting reconnect
2015-05-25 18:06:31,561 [myid:] - INFO  [main-SendThread(127.0.0.1:4083):ClientCnxn$SendThread@975] - Opening socket connection to server 127.0.0.1/127.0.0.1:4083. Will not attempt to authenticate using SASL (java.lang.SecurityException: ?޷???λ??¼????)

后來才搞明白,由於我在zoo.cfg中配置了3台機器,但是只啟動了1台,zookeeper就會認為服務處於不可用狀態。

zookeeper有個選舉算法,當整個集群超過半數機器宕機,zookeeper會認為集群處於不可用狀態。

所有,3台機器只啟動一台無法連接,如果啟動2台及以上就可以連接了。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM