Cannot open channel to 3 at election address /100.73.41.14: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:562)
at org.apache.zookeeper.server.quorum.QuorumCnxManager.toSend(QuorumCnxManager.java:538)
at org.apache.zookeeper.server.quorum.FastLeaderElection$Messenger$WorkerSender.process(FastLeaderElection.java:452)
at org.apache.zookeeper.server.quorum.FastLeaderElection$Messenger$WorkerSender.run(FastLeaderElection.java:433)
at java.lang.Thread.run(Thread.java:745)
查了很多资料,说有多种可能性
1. 防火墙问题 方法:关闭防火墙或者开放对应端口
2. 有zoo.cfg配置文件问题, 仔细检查一遍
3. jdk的问题(这个我没遇到过)
可我发现我不是这些问题,我防火墙关闭了, 配置也检查了好几遍了,还是开启不了
最后在i2麒麟的http://blog.csdn.net/qq_26840065/article/details/50985765 博客中找到了解决方案
把第一个配置好的zoo.cfg 复制到其他集群机器上
然后重启zookeeper 就可以了
记录一下,同时也为其他人少走弯路做点帮助