cenos 7 zookeeper Error contacting service. It is probably not running

zkServer.sh status 命令查看zookeeper集羣的狀態,發現異常

Error contacting service. It is probably not running

最開始以爲是server配置的myid有問題,後面看了下zookeeper.out文件,發現連接不到端口,有可能是防火牆攔截造成的原因

 

WARN [QuorumPeer[myid=1]/0:0:0:0:0:0:0:0:2181:QuorumCnx[email protected]] - Cannot open channel to 3 at election address /192.168.36.13:3888
java.net.NoRouteToHostException: 沒有到主機的路由 (Host unreachable)
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at org.apache.zookeeper.server.quorum.QuorumCnxManager.connectOne(QuorumCnxManager.java:381)
at org.apache.zookeeper.server.quorum.QuorumCnxManager.connectAll(QuorumCnxManager.java:426)
at org.apache.zookeeper.server.quorum.FastLeaderElection.lookForLeader(FastLeaderElection.java:843)
at org.apache.zookeeper.server.quorum.QuorumPeer.run(QuorumPeer.java:822)

 

設置關閉防火牆

]# systemctl stop firewalld

 

禁止防火牆開機啓動。

]# systemctl disable firewalld

 

後刪除dataDir下除myid,重啓zookeeper 即可使用

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章