查询zookeeper状态时遇到Error contacting service. It is probably not running
- 系统环境:
Centos7
怎么遇到的问题
三台虚拟机的zookeeper均安装成功且已启动。但是,查询状态时遇到一下问题
Error contacting service. It is probably not running.
-
开始排查问题
1.查看zoo.cfg的ip地址是否正确–无误
2.查看每台机器 myid是否正确–无误
3.查看防火墙是否开启–问题所在 -
解决问题的过程
执行了以下命令因此认为防火墙已关闭
service iptables stop
但是仍然报错,经过查阅网上资料,发现需要使用下面的命令systemctl stop firewalld.service systemctl disable firewalld.service
原因在于 CentOS 7.0 中已经用 firewalld 取代 iptables进行管理防火墙
扩展
1.firewalld的基本使用
启动: systemctl start firewalld
查看状态: systemctl status firewalld
停止: systemctl disable firewalld
禁用: systemctl stop firewalld
2.systemctl命令
systemctl是CentOS7的服务管理工具中主要的工具,它融合之前service和chkconfig的功能于一体。
启动一个服务:systemctl start firewalld.service
关闭一个服务:systemctl stop firewalld.service
重启一个服务:systemctl restart firewalld.service
显示一个服务的状态:systemctl status firewalld.service
在开机时启用一个服务:systemctl enable firewalld.service
在开机时禁用一个服务:systemctl disable firewalld.service
查看服务是否开机启动:systemctl is-enabled firewalld.service
查看已启动的服务列表:systemctl list-unit-files|grep enabled
查看启动失败的服务列表:systemctl --failed
总结
对于Linux命令还不是很清楚,之前一直使用CentOS6,对于CentOS7的变化一无所知。后续研究二者之间的改变,以便于以后命令的调整
感谢
参考以下文章,感谢他们的整理
https://www.jianshu.com/p/2abcbd51ded5
https://yq.aliyun.com/articles/625659