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:QuorumCnxManager@400] - 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 即可使用

 

posted @ 2021-11-17 23:45  ☆♂安♀★  阅读(142)  评论(0编辑  收藏  举报