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

created at 11-20-2021 views: 9


Using the zkServer.sh status command to check the status of the zookeeper cluster, and finds an exception

Error contacting service. It is probably not running


At first I thought that there was a problem with the myid configured by the server. Later I looked at the zookeeper.out file and found that the port could not be connected. This may be caused by the firewall interception.

WARN [QuorumPeer[myid=1]/0:0:0:0:0:0:0:0:2181:QuorumCnxManager@400] - Cannot open channel to 3 at election address /
java.net.NoRouteToHostException: No route to host (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)

1 Set to turn off the firewall

systemctl stop firewalld

2 Prohibit the firewall from booting up.

systemctl disable firewalld

After deleting dataDir, except myid, restart zookeeper to use

created at:11-20-2021
edited at: 11-20-2021: