正文
[异常笔记] zookeeper集群启动异常: Cannot open channel to 2 at election address ……
小程序:扫一扫查出行
【扫一扫了解最新限行尾号】
复制小程序
【扫一扫了解最新限行尾号】
复制小程序
- ::, [myid:] - WARN [WorkerSender[myid=]:QuorumCnxManager@] - Cannot open channel to at election address cdh03/192.168.5.148:
java.net.ConnectException: Connection refused (Connection refused)
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:)
at java.net.Socket.connect(Socket.java:)
at org.apache.zookeeper.server.quorum.QuorumCnxManager.connectOne(QuorumCnxManager.java:)
at org.apache.zookeeper.server.quorum.QuorumCnxManager.toSend(QuorumCnxManager.java:)
at org.apache.zookeeper.server.quorum.FastLeaderElection$Messenger$WorkerSender.process(FastLeaderElection.java:)
at org.apache.zookeeper.server.quorum.FastLeaderElection$Messenger$WorkerSender.run(FastLeaderElection.java:)
at java.lang.Thread.run(Thread.java:)
- ::, [myid:] - INFO [WorkerSender[myid=]:QuorumPeer$QuorumServer@] - Resolved hostname: cdh03 to address: cdh03/192.168.5.148
- ::, [myid:] - WARN [WorkerSender[myid=]:QuorumCnxManager@] - Cannot open channel to at election address cdh04/192.168.5.149:
java.net.ConnectException: Connection refused (Connection refused)
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:)
at java.net.Socket.connect(Socket.java:)
at org.apache.zookeeper.server.quorum.QuorumCnxManager.connectOne(QuorumCnxManager.java:)
at org.apache.zookeeper.server.quorum.QuorumCnxManager.toSend(QuorumCnxManager.java:)
at org.apache.zookeeper.server.quorum.FastLeaderElection$Messenger$WorkerSender.process(FastLeaderElection.java:)
at org.apache.zookeeper.server.quorum.FastLeaderElection$Messenger$WorkerSender.run(FastLeaderElection.java:)
at java.lang.Thread.run(Thread.java:)
- ::, [myid:] - INFO [WorkerSender[myid=]:QuorumPeer$QuorumServer@] - Resolved hostname: cdh04 to address: cdh04/192.168.5.149
- ::, [myid:] - WARN [QuorumPeer[myid=]/:::::::::QuorumCnxManager@] - Cannot open channel to at election address cdh03/192.168.5.148:
java.net.ConnectException: Connection refused (Connection refused)
解决方法:本机用节点 用 0.0.0.0 IP代替主机名
[hadoop@cdh02 ~]$ cat /opt/software/zookeeper-3.4./conf/zoo.cfg
server.=0.0.0.0::
server.=cdh03::
server.=cdh04:: [hadoop@cdh03 ~]$ cat /opt/software/zookeeper-3.4./conf/zoo.cfg
server.=cdh02::
server.=0.0.0.0::
server.=cdh04:: [hadoop@cdh04 ~]$ cat /opt/software/zookeeper-3.4./conf/zoo.cfg
server.=cdh02::
server.=cdh03::
server.=0.0.0.0::