zookeeper启动后,查看status,报Error contacting service. It is probably not running.解决办法!

zookeeper一启动就开始查询zookeeper状态,然后报如下错误!

ZooKeeper JMX enabled by default
Using config: /home/node2/zookeeper-3.4.14/bin/../conf/zoo.cfg
Error contacting service. It is probably not running.

网上帖子很多,关防火墙、配置myid、端口占用、hosts文件修改、hosts中自己ip改为0.0.0.0等等!

然后意外的是:在你zookeeper集群没有启动时,单个启动zookeeper永远都会报这个错!!

查看是否有启动:

ps -ef |  grep zookeeper

node2      3274      1  0 17:50 pts/0    00:00:01 java -Dzookeeper.log.dir=. -Dzookeeper.root.logger=INFO,CONSOLE -cp /home/node2/zookeeper-3.4.14/bin/../zookeeper-server/target/classes:/home/node2/zookeeper-3.4.14/bin/../build/classes:/home/node2/zookeeper-3.4.14/bin/../zookeeper-server/target/lib/*.jar:/home/node2/zookeeper-3.4.14/bin/../build/lib/*.jar:/home/node2/zookeeper-3.4.14/bin/../lib/slf4j-log4j12-1.7.25.jar:/home/node2/zookeeper-3.4.14/bin/../lib/slf4j-api-1.7.25.jar:/home/node2/zookeeper-3.4.14/bin/../lib/netty-3.10.6.Final.jar:/home/node2/zookeeper-3.4.14/bin/../lib/log4j-1.2.17.jar:/home/node2/zookeeper-3.4.14/bin/../lib/jline-0.9.94.jar:/home/node2/zookeeper-3.4.14/bin/../lib/audience-annotations-0.5.0.jar:/home/node2/zookeeper-3.4.14/bin/../zookeeper-3.4.14.jar:/home/node2/zookeeper-3.4.14/bin/../zookeeper-server/src/main/resources/lib/*.jar:/home/node2/zookeeper-3.4.14/bin/../conf: -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.local.only=false org.apache.zookeeper.server.quorum.QuorumPeerMain /home/node2/zookeeper-3.4.14/bin/../conf/zoo.cfg
node2      3473   1628  0 17:59 pts/0    00:00:00 grep --color=auto zookeeper

如果ps有看到你程序启动,且查看zookeeper的status为上述报错!那么可能是集群没启动,先启动集群吧。

解决办法:就是启动集群,然后再查看状态!
 

 

 

你可能感兴趣的:(灭霸)