首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >AWS上的Zookeeper集群

AWS上的Zookeeper集群
EN

Stack Overflow用户
提问于 2016-10-20 00:37:51
回答 1查看 1.2K关注 0票数 1

我尝试在3台AWS ec2机器上设置zookeeper集群,但仍然收到相同的错误:

代码语言:javascript
复制
2016-10-19 16:30:23,177 [myid:2] - WARN  [QuorumPeer[myid=2]/0:0:0:0:0:0:0:0:2181:QuorumCnxManager@382] - Cannot open channel to 3 at election address /xxx.31.34.102:3888
java.net.SocketTimeoutException: connect timed out
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
    at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
    at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
    at java.net.Socket.connect(Socket.java:589)
    at org.apache.zookeeper.server.quorum.QuorumCnxManager.connectOne(QuorumCnxManager.java:368)
    at org.apache.zookeeper.server.quorum.QuorumCnxManager.connectAll(QuorumCnxManager.java:402)
    at org.apache.zookeeper.server.quorum.FastLeaderElection.lookForLeader(FastLeaderElection.java:840)
    at org.apache.zookeeper.server.quorum.QuorumPeer.run(QuorumPeer.java:762)
2016-10-19 16:30:23,185 [myid:2] - INFO  [QuorumPeer[myid=2]/0:0:0:0:0:0:0:0:2181:FastLeaderElection@849] - Notification time out: 60000

1)三台机器都有相同的安全组。

2)在conf中使用机器的私有ips

代码语言:javascript
复制
# 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=/opt/data
# 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.purgeIinterval=1
server.1=0.0.0.0:2888:3888
server.2=x.31.34.105:2888:3888
server.3=x.31.34.102:2888:3888

3)甚至用自己机器的实际内网ip测试,而不是0.0.0.0。

找不到哪里出了问题。

EN

回答 1

Stack Overflow用户

发布于 2016-11-26 02:03:56

对于每个节点,必须确保已将0.0.0.0指定为该节点的ip地址。

即:对于服务器01

代码语言:javascript
复制
server.1=0.0.0.0:2888:3888
server.2=192.168.10.10:2888:3888
server.3=192.168.2.1:2888:3888

对于服务器02

代码语言:javascript
复制
server.1=192.168.x.x:2888:3888
server.2=0.0.0.0:2888:3888
server.3=192.168.2.1:2888:3888

对于服务器

代码语言:javascript
复制
server.1=192.168.x.x:2888:3888
server.2=192.168.10.10:2888:3888
server.3=0.0.0.0:2888:3888
票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/40137077

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档