zookeeper集群启动失败报错解决

1.报错内容

三台主机安装zookeeper组件,发现只启动了其中一台,其他两台没有启动成功,但是检查配置文件之后发现都没有错误

配置文件没问题,查看日志文件:zookeeper.out

zookeeper.out日志文件,你在哪里启动,就在那个文件夹中,我过滤出错误的信息出来

[root@ip-172-31-24-103 zookeeper]# cat zookeeper.out |grep ERR
2020-07-27 08:29:54,147 [myid:3] - ERROR [/172.31.24.103:3888:QuorumCnxManager$Listener@760] - Exception while listening
2020-07-27 08:29:55,149 [myid:3] - ERROR [/172.31.24.103:3888:QuorumCnxManager$Listener@760] - Exception while listening
2020-07-27 08:29:56,150 [myid:3] - ERROR [/172.31.24.103:3888:QuorumCnxManager$Listener@760] - Exception while listening
2020-07-27 08:29:57,150 [myid:3] - ERROR [/172.31.24.103:3888:QuorumCnxManager$Listener@775] - As I'm leaving the listener thread, I won't be able to participate in leader election any longer: /172.31.24.103:3888

2.报错分析

发现这个问题是属于进程或者端口或者IP地址等被占用的情况,然后使用jps命令查看启动的java进程,发现有重复的

[root@ip-172-31-24-103 zookeeper]# jps
13234 Jps
11192 QuorumPeerMain
13146 QuorumPeerMain
12637 Kafka



3.解决方法

删除重复的Quorum进程,重新启动服务即可

[root@ip-172-31-24-103 zookeeper]# kill -9 11192
[root@ip-172-31-24-103 zookeeper]# kill -9 13146
[root@ip-172-31-24-103 zookeeper]# /data/ota_soft/zookeeper/bin/zkServer.sh start
ZooKeeper JMX enabled by default
Using config: /data/ota_soft/zookeeper/bin/../conf/zoo.cfg
Starting zookeeper ... STARTED
[root@ip-172-31-24-103 zookeeper]# /data/ota_soft/zookeeper/bin/zkServer.sh status
ZooKeeper JMX enabled by default
Using config: /data/ota_soft/zookeeper/bin/../conf/zoo.cfg
Mode: follower

你可能感兴趣的:(踩坑日志,java,zookeeper,linux,报错,运维)