Linux环境:Zookeeper:Error contacting service. It is probably not running
问题描述
Linux环境下Zookeeper使用命令bin/zkServer.sh status 查看开启状态时报如下错:
Error contacting service. It is probably not running
原因分析:
个人排查原因如下:防火墙未关闭
systemctl status firewalld #查看防火墙状态
同时项目运行环境在未关闭防火墙的情况下,还会报错org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss
解决方案:
1、service firewalld stop #关闭防火墙
2、删除dataDir目录下的zookeeper_server.pid文件然后重启zookeeper,不会再报错