zookeeper集群启动失败

来源:5-3 三台物理机(虚拟机)安装zookeeper集群

慕设计7183418

2018-03-31

三台机器

zoo.cfg如下:

# The number of milliseconds of each tick

tickTime=2000

# The number of ticks that the initial

# synchronization phase can take

initLimit=10

# The number of ticks that can pass between

# sending a request and getting an acknowledgement

syncLimit=5

# the directory where the snapshot is stored.

# do not use /tmp for storage, /tmp here is just

# example sakes.

dataDir=/usr/local/zookeeper_cluster_01/dataDir

dataLogDir=/usr/local/zookeeper_cluster_01/dataLogDir

# the port at which the clients will connect

clientPort=2181

# the maximum number of client connections.

# increase this if you need to handle more clients

#maxClientCnxns=60

#

# Be sure to read the maintenance section of the

# administrator guide before turning on autopurge.

#

# http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance

#

# The number of snapshots to retain in dataDir

#autopurge.snapRetainCount=3

# Purge task interval in hours

# Set to "0" to disable auto purge feature

#autopurge.purgeInterval=1


server.1=10.62.129.112:2888:3888

server.2=10.61.145.246:2888:3888

server.3=10.60.95.249:2888:3888


三台机器之间可以ping通

启动./zkServer.sh后,日志如下:

http://img.mukewang.com/szimg/5abf1495000183e227071355.jpg


写回答

4回答

慕设计7183418

提问者

2018-03-31

@风间影月

谢谢老师的指导

具体问题说明如下:

青云在基础网络下创建云主机后,默认有个防火墙,该防火墙默认只开放了一下一些端口

//img.mukewang.com/szimg/5abf8096000105a314140430.jpg

需要手动添加规则,开放zk用到的端口

//img.mukewang.com/szimg/5abf80dd0001a97f14200717.jpg

这样就可以了

@all

各个云平台的不太一样,有的是安全组

0
0

风间影月

2018-03-31

@all  问题已解决,如果使用到了公网IP,那就需要打开防火墙(或者安全组)里对应的端口号

//img.mukewang.com/szimg/5abf7e7e0001fefa14150717.jpg

0
0

慕设计7183418

提问者

2018-03-31

这三个ip都是内网ip,是青云上的三个云主机,10.62.129.112挂了公网ip

  1. 三台机器上的防火墙都没有启动

  2. 尝试把三个节点的配置文件改成0.0.0.0:2888:3888

还是不ok

0
0

风间影月

2018-03-31

你好,请问你使用的这3个ip都是公网IP还是内网IP?

如果是公网IP,那么 10.62.129.112,10.61.145.246,10.60.95.249,建议换成内网IP;

另外防火墙需要关闭,同时开发对应的所有端口。

如果这3台机子都同时有公网IP和内网IP,那么再试试如下配置:

server1:

server.1=0.0.0.0:2888:3888

server.2=10.61.145.246:2888:3888

server.3=10.60.95.249:2888:3888


server2:

server.1=10.62.129.112:2888:3888

server.2=0.0.0.0:2888:3888

server.3=10.60.95.249:2888:3888


server3:

server.1=10.62.129.112:2888:3888

server.2=10.61.145.246:2888:3888

server.3=0.0.0.0:2888:3888


0
0

ZK分布式专题与Dubbo微服务入门,成长与加薪必备

进阶中高级工程师必备技能,大数据与微服务最常用的中间件

1859 学习 · 321 问题

查看课程