Zookeeper错误:无法打开选举地址上的X通道

我已经在3个不同的AWS服务器中安装了zookeeper。以下是所有服务器中的配置

tickTime=2000

initLimit=10

syncLimit=5

dataDir=/var/zookeeper

clientPort=2181

server.1=x.x.x.x:2888:3888

server.2=x.x.x.x:2888:3888

server.3=x.x.x.x:2888:3888

所有这三个实例都有一个myid文件,var/zookeeper其中包含适当的ID。所有这三台服务器都通过aws控制台打开了所有端口。但是,当我运行zookeeper服务器时,在所有实例中都出现以下错误。

2015-06-19 12:09:22,989 [myid:1] - WARN  [QuorumPeer[myid=1]/0:0:0:0:0:0:0:0:2181:QuorumCnxManager@382] 

- Cannot open channel to 2 at election address /x.x.x.x:3888

java.net.ConnectException: Connection refused

at java.net.PlainSocketImpl.socketConnect(Native Method)

at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)

at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)

at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)

at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)

at java.net.Socket.connect(Socket.java:579)

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)

2015-06-19 12:09:23,170 [myid:1] - WARN [QuorumPeer[myid=1]/0:0:0:0:0:0:0:0:2181:QuorumCnxManager@382]

- Cannot open channel to 3 at election address /x.x.x.x:3888

java.net.ConnectException: Connection refused

at java.net.PlainSocketImpl.socketConnect(Native Method)

at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)

at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)

at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)

at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)

at java.net.Socket.connect(Socket.java:579)

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)

2015-06-19 12:09:23,170 [myid:1] - INFO [QuorumPeer[myid=1]/0:0:0:0:0:0:0:0:2181:FastLeaderElection@849] - Notification time out: 25600

回答:

如何在每个节点中定义本地服务器的IP?如果您提供了公共IP,则侦听器将无法连接到端口。您必须为当前节点指定0.0.0.0

server.1=0.0.0.0:2888:3888

server.2=192.168.10.10:2888:3888

server.3=192.168.2.1:2888:3888

此更改也必须在其他节点上执行。

以上是 Zookeeper错误:无法打开选举地址上的X通道 的全部内容, 来源链接: utcz.com/qa/411119.html

回到顶部