Zookeeper配置集群后,启动会报“Error contacting service. It is probably not running.”


[root@test58 bin]# ./zkServer.sh status
JMX enabled by default
Using config: /opt/zookeeper/bin/../conf/zoo.cfg
Error contacting service. It is probably not running.
原因,上一次启动时port被占用
[root@test58 bin]# netstat -ptnl |grep 2181
tcp 0 0 :::2181 :::* LISTEN 9907/java

解决办法:
[root@test58 bin]# kill -9 9907
[root@test58 bin]# ./zkServer.sh stop
JMX enabled by default
Using config: /opt/zookeeper/bin/../conf/zoo.cfg
Stopping zookeeper ... ./zkServer.sh: line 143: kill: (16797) - No such process
STOPPED
[root@test58 bin]# ./zkServer.sh start
JMX enabled by default
Using config: /opt/zookeeper/bin/../conf/zoo.cfg
Starting zookeeper ... STARTED
[root@test58 bin]# ./zkServer.sh status
JMX enabled by default
Using config: /opt/zookeeper/bin/../conf/zoo.cfg
Mode: follower
[root@test58 bin]# 

Logo

权威|前沿|技术|干货|国内首个API全生命周期开发者社区

更多推荐