查询zookeeper状态遇到Error contacting service. It is probably not running

在Centos7系统中,三台虚拟机的zookeeper安装并启动后,查询状态时出现Error contacting service. It is probably not running错误。经排查,发现问题出在防火墙。因CentOS 7用firewalld取代iptables管理防火墙,需用特定命令解决。还介绍了firewalld和systemctl命令的使用。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

查询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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值