报错如下
zookeeper3节点集群部署完成后,修改配置文件后,无法启动,
甚至启动失败
[root@centos conf]# zkServer.sh start
ZooKeeper JMX enabled by default
Using config: /usr/local/src/zookeeper-3.5.8/bin/../conf/zoo.cfg
Starting zookeeper ... STARTED
[root@centos conf]# zkServer.sh status
ZooKeeper JMX enabled by default
Using config: /usr/local/src/zookeeper-3.5.8/bin/../conf/zoo.cfg
Error contacting service. It is probably not running.
[root@centos conf]# zkServer.sh start
ZooKeeper JMX enabled by default
Using config: /usr/local/src/zookeeper-3.5.8/bin/../conf/zoo.cfg
Starting zookeeper ... FAILE TO STARTED
[root@centos conf]# zkServer.sh status
ZooKeeper JMX enabled by default
Using config: /usr/local/src/zookeeper-3.5.8/bin/../conf/zoo.cfg
Error contacting service. It is probably not running.
解决办法:
- 检查防火墙,需要开放2181端口或者关闭防火墙
- 确保配置文件里的myid与server后面参数的对应正确
dataDir=/data/zookeeper
clientPort=2181
tickTime=2000
initLimit=20
syncLimit=10
server.1=192.168.10.2:2888:3888
server.2=192.168.10.1:2888:3888
server.3=192.168.10.7:2888:3888
[root@localhost ~]# cat /data/zookeeper/myid
1
[root@localhost ~]#
##########################################
2,3节点依次根据配置文件自己一一对应
- 如果还是启动不了,检查你是不是版本选错了
zookeeper官网最新版zookeeper3.5.5
版本以后,我们需要下载的包是apache-zookeeper-3.5.x-bin.tar.gz
带bin
才是二进制编译完后的包,我们可以直接使用
而之前的普通的tar.gz
的包里面是只是源码的包无法直接使用