我是靠谱客的博主 温柔盼望,最近开发中收集的这篇文章主要介绍zookeeper 启动错误Error contacting service. It is probably not running,觉得挺不错的,现在分享给大家,希望可以做个参考。
概述
./zkServer.sh start
zookeeper版本为apache-zookeeper-3.7.1
启动zookeeper后
[root@localhost bin]# ./zkServer.sh start
/data/jdk/jdk1.8.0_261/bin/java
ZooKeeper JMX enabled by default
Using config: /data/zk/zookeeper/bin/../conf/zoo.cfg
Starting zookeeper ... STARTED
查看zookeeper的状态
[root@localhost bin]# ./zkServer.sh status
/data/jdk/jdk1.8.0_261/bin/java
ZooKeeper JMX enabled by default
Using config: /data/zk/zookeeper/bin/../conf/zoo.cfg
Client port found: 2181. Client address: localhost. Client SSL: false.
Error contacting service. It is probably not running.
网上找了很多,基本上说的是myid配置问题,或者日志路径不对,没有提前创建好日志的路径等等,都是不错的思路,但是本人都一一尝试没有解决,没有办法还是只能靠自己,只能去看kafka的启动日志。
查看日志
本人的日志路径为:/data/zk/zookeeper/logs下的 zookeeper-root-server-localhost.localdomain.out
本人不确定不同kafka版本日志的名字是否相同,但是大同小异,这里的kafka版本为apache-zookeeper-3.7.1
查看日志后发现如下:
2022-05-14 04:00:39,030 [myid:1] - WARN [QuorumConnectionThread-[myid=1]-1:QuorumCnxManager@401] - Cannot open channel to 2 at election address /192.168.234.141:3888
java.net.NoRouteToHostException: No route to host (Host unreachable)
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:476)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:218)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:200)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:394)
at java.net.Socket.connect(Socket.java:606)
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:748)
由此可见,没办法连接另一台的机器141(本机像作为master ip为140),于是去看看防火墙是否拦截
查看防火墙状态
systemctl status firewalld
要么停止防火墙,要么配置相关规则
下面附赠防火墙相关命令
`
最后
以上就是温柔盼望为你收集整理的zookeeper 启动错误Error contacting service. It is probably not running的全部内容,希望文章能够帮你解决zookeeper 启动错误Error contacting service. It is probably not running所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复