常规打法,关防火墙,关selinux
注意一:启动之前关闭防火墙或者配置安全组策略
关闭 systemctl status firewalld.service
停止防火墙命令 systemctl stop firewalld
开机禁止启动命令 systemctl disable firewalld
注意二:集群中的selinux
getenforce: disabled : 已经关闭
setenforce 0 临时关闭
vim /etc/selinux/config 改为disabled
配置myid
配置zoo.cfg
启动后报java.net.ConnectException: Connection refused (Connection refused)
一般遇到这种问题,就是检查防火墙是否关闭。
我的几台机器,检查了好几遍,ping也都通。装过好几次也没出现过这种问题。
然后telnet 2181,2888,3888 不通。
结果最后检查/etc/hosts ,发现把主机名bgxx写到
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 bg02
后面了。去掉后一切正常了。
谨记!!!!