Get the App
SLTechnology News&Howtos  ›  Servers  › 

Zookeeper cluster check status Times error Error contacting service. It is

Shulou Source: shulou.com Published: 2022-06-02 14:32:50 09月17日 Update

Recently, you need to use zookeeper when building a mq cluster, but it shows success when starting up, but an error is reported when checking the status:

It takes a long time to solve this problem, so here we sum up a quick solution!

First of all, you must look at the log:

Generally speaking, the error message is in this file under the current directory. Basically, I come across two kinds of reasons: one is port occupation, and the other is that the route cannot be found:

Another is that the port is occupied. Netstat-znpl | grep 2181 check and shut down the process. The default port is 2181. CFG is configurable.

! Here is a hint: zoo_sample.cfg must be changed to z.cfg, otherwise it cannot be started, and to check the status, all nodes configured with clusters must be started, because they have to communicate with each other to elect the boss.

Because of the above picture, the firewall blocked the communication, so the only thing to do was to turn off the firewall, so here comes the crappy point. I used centos7, and then turned it off and found it still didn't work. Later, I remembered that in order to use the habit, I didn't know when to replace the firewall with iptables, which was a trick, and then I could just turn it all off and check the success:

Note: after shutting down, it is best to adjust the port by kill, restart it all, and then take a look at the output log to see if there is an error, or not.

Here are the closing methods for firewalld and IPtables:

Firewalld (usually centos7 or above):

Temporary shutdown: systemctl stop firewalld.service

View status: systemctl status firewalld.service

Boot is disabled (reboot is required): systemctl disable firewalld.service

IPtables (before centos6):

Temporarily turn off the firewall: (effective immediately, boot reboot, it will be turned on again)

Service iptables stop

Permanently shut down the firewall (shutdown and restart will take effect)

Chkconfig iptables off

If it's in centos7, it needs to be written in a different way:

Systemctl stop iptables.service, the others are the same.

Tags: Firewall fire protection time port status cluster success log communication configuration bad information writing method reason only name genius that is file Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Tech Info Shulou Information MySQL OPPO Reno Docker