一、错误原文
[root@localhost bin]# zkServer.sh start --启动命令
JMX enabled by default
Using config: /yiang/zookeeper/bin/../conf/zoo.cfg
Starting zookeeper ... already running as process 1911. --显示启动 进程为1911
[root@localhost bin]# zkServer.sh status --查看状态
JMX enabled by default
Using config: /yiang/zookeeper/bin/../conf/zoo.cfg --配置文件路径
Error contacting service. It is probably not running. --错误联系服务。它可能没有运行。
二、解决思路
错误联系服务,意思就是联系不到服务,那么联系不到服务有几种情况
1.服务未成功启动或服务已宕机 (不属于我的情况)
2.服务器端口未打开 (属于我的情况)
三、解决方案
请关闭三台机器防火墙!或者打开服务器对应端口!
启动: systemctl start firewalld
关闭: systemctl stop firewalld
查看状态: systemctl status firewalld
开机禁用 : systemctl disable firewalld
开机启用 : systemctl enable firewalld
添加
firewall-cmd --zone=public --add-port=80/tcp --permanent (--permanent永久生效,没有此参数重启后失效)
重新载入
firewall-cmd --reload
查看
firewall-cmd --zone= public --query-port=80/tcp
删除
firewall-cmd --zone= public --remove-port=80/tcp --permanent