zookeeper報Unable to read additional data from server sessionid 0x0, likely server has closed socket, closing socket connection and attempting reconnect的解決


現象

服務器連不上,kafka報connection refused

測試發現kafka某台node(xx)的問題,登錄上去也各種錯誤,zkServer.sh restart可以完成,但status報連不上。報錯比較迷惑人,打開java log看到其他錯誤:

——————————

kafka complains connection refused. check it's a node's problem, even restart cannot fix. see java log below:

[myid:3] - INFO  [ListenerThread:QuorumCnxManager$Listener@534] - My election bind port: /yy:3888

java.net.BindException: Cannot assign requested address

...

[myid:3] - WARN  [WorkerSender[myid=3]:QuorumCnxManager@400] - Cannot open channel to 1 at election address /xx:3888

java.net.ConnectException: Connection refused

其實這個錯誤可以看出來,出現了xx和yy2個地址,說明它認錯了自己

——————————

the cause is setting config wrong  

解決方案

從zoo.cfg看下datadir,將下面的myid改成和zoo.cfg里的自己一樣的。比如xx是

server.1=xx:2888:3888
server.2=yy:2888:3888
server.3=zz:2888:3888

那么它的myid必須是1

————————————

the right way is to make myid's id same with zoo.cfg's


免責聲明!

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



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