zookeeper搭建分布式集群启动失败(Error contacting service. It is probably not running.)

文章目录

1.排查

1.启动zookeeper后查看状态/bin/zkServer.sh status发现报错Error contacting service. It is probably not running.

bash 复制代码
[root@zookeeper01 apache-zookeeper-3.8.2-bin]# ./bin/zkServer.sh status
/usr/bin/java
ZooKeeper JMX enabled by default
Using config: /opt/apache-zookeeper-3.8.2-bin/bin/../conf/zoo.cfg
Client port found: 2181. Client address: localhost. Client SSL: false.
Error contacting service. It is probably not running.

2.查看日志zookeeper-root-server-zookeeper01.out

发现报了一拒绝链接java.net.ConnectException: 拒绝连接 (Connection refused)

bash 复制代码
[root@zookeeper01 logs]# pwd
/opt/apache-zookeeper-3.8.2-bin/logs
[root@zookeeper01 logs]# ls
zookeeper-root-server-zookeeper01.out
[root@zookeeper01 logs]# vim zookeeper-root-server-zookeeper01.out
bash 复制代码
2023-09-05 01:09:12,322 [myid:] - INFO  [QuorumPeer[myid=1](plain=[0:0:0:0:0:0:0:0]:2181)(secure=disabled):o.a.z.s.q.FastLeaderElection@996] - Notification time out: 400 ms
2023-09-05 01:09:12,323 [myid:] - WARN  [QuorumConnectionThread-[myid=1]-2:o.a.z.s.q.QuorumCnxManager@401] - Cannot open channel to 3 at election address zookeeper03/192.168.75.132:3888
java.net.ConnectException: 拒绝连接 (Connection refused)
        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:607)
        at org.apache.zookeeper.server.quorum.QuorumCnxManager.initiateConnection(QuorumCnxManager.java:384)
        at org.apache.zookeeper.server.quorum.QuorumCnxManager$QuorumConnectionReqThread.run(QuorumCnxManager.java:458)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:750)

2.解决

将配置文件zoo.cfg中节点对应机器的地址改为:0.0.0.0

修改完再此启动即可解决。

注意:每台机器都要改。不能只改一个节点

bash 复制代码
server.1=0.0.0.0:2888:3888
server.2=zookeeper02:2888:3888
server.3=zookeeper03:2888:3888
quorumListenOnAllIPs=true
相关推荐
pblh1236 分钟前
2023_Spark_实验十五:SparkSQL进阶操作
大数据·分布式·spark
silver98861 小时前
分布式相关杂项
分布式
politeboy1 小时前
关于k8s中镜像的服务端口被拒绝的问题
云原生·容器·kubernetes
weixin_438197381 小时前
K8S创建云主机配置docker仓库
linux·云原生·容器·eureka·kubernetes
jerry6097 小时前
7天用Go从零实现分布式缓存GeeCache(改进)(未完待续)
分布式·缓存·golang
古人诚不我欺9 小时前
jmeter常用配置元件介绍总结之分布式压测
分布式·jmeter
星染xr11 小时前
kafka 生产经验——数据积压(消费者如何提高吞吐量)
分布式·kafka
东方巴黎~Sunsiny11 小时前
如何监控Kafka消费者的性能指标?
分布式·kafka
飞升不如收破烂~11 小时前
kafka
分布式·kafka
ggaofeng12 小时前
通过命令学习k8s
云原生·容器·kubernetes