Wyy_Ck 发表于 2017-6-10 19:21:14

发一个zookeeper配置的错误

完全按照网上说法配置zookeeper   有下面错误:
2017-06-10 04:33:16,375 - WARN/0:0:0:0:0:0:0:0:2181:QuorumCnxManager@400] - Cannot open channel to 2 at election address /192.168.86.132:38888
java.net.ConnectException: 拒绝连接
        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:381)
        at org.apache.zookeeper.server.quorum.QuorumCnxManager.connectAll(QuorumCnxManager.java:426)
        at org.apache.zookeeper.server.quorum.FastLeaderElection.lookForLeader(FastLeaderElection.java:843)
        at org.apache.zookeeper.server.quorum.QuorumPeer.run(QuorumPeer.java:822)
2017-06-10 04:33:16,376 - INFO/0:0:0:0:0:0:0:0:2181:QuorumPeer$QuorumServer@149] - Resolved hostname: 192.168.86.132 to address: /192.168.86.132
2017-06-10 04:33:16,378 - WARN/0:0:0:0:0:0:0:0:2181:QuorumCnxManager@400] - Cannot open channel to 3 at election address /192.168.86.134:38888
java.net.ConnectException: 拒绝连接
        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:381)
        at org.apache.zookeeper.server.quorum.QuorumCnxManager.connectAll(QuorumCnxManager.java:426)
        at org.apache.zookeeper.server.quorum.FastLeaderElection.lookForLeader(FastLeaderElection.java:843)
        at org.apache.zookeeper.server.quorum.QuorumPeer.run(QuorumPeer.java:822)
2017-06-10 04:33:16,379 - INFO/0:0:0:0:0:0:0:0:2181:QuorumPeer$QuorumServer@149] - Resolved hostname: 192.168.86.134 to address: /192.168.86.134
2017-06-10 04:33:16,379 - INFO/0:0:0:0:0:0:0:0:2181:FastLeaderElection@852] - Notification time out: 51200

Wyy_Ck 发表于 2017-6-10 19:21:46

防火墙都是关闭的

   Active: inactive (dead) since 六 2017-06-10 00:42:37 EDT; 3h 53min ago

desehawk 发表于 2017-6-10 21:20:27

lsof -i:2181
看下端口是否被暂用

Wyy_Ck 发表于 2017-6-10 23:07:04

desehawk 发表于 2017-6-10 21:20
lsof -i:2181
看下端口是否被暂用
使用netatat 命令查看了 2181只有master的zookeeper使用子节点不启动 如下:
# zkServer.sh start
ZooKeeper JMX enabled by default
Using config: /opt/zookeeper/bin/../conf/zoo.cfg
Starting zookeeper ... STARTED
# netstat -anp|grep 2181
tcp6       0      0 :::2181               :::*                  LISTEN      7626/java         
# cat /data/zookeeper/
log/                  myid                  version-2/            zookeeper.out         zookeeper_server.pid
# cat /data/zookeeper/zookeeper_server.pid
7626#



还是报错如下:
2017-06-10 08:14:02,180 - INFO/0:0:0:0:0:0:0:0:2181:QuorumPeer$QuorumServer@149] - Resolved hostname: 192.168.86.132 to address: /192.168.86.132
2017-06-10 08:14:02,182 - WARN/0:0:0:0:0:0:0:0:2181:QuorumCnxManager@400] - Cannot open channel to 3 at election address /192.168.86.134:3888
java.net.ConnectException: 拒绝连接
        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:381)
        at org.apache.zookeeper.server.quorum.QuorumCnxManager.connectAll(QuorumCnxManager.java:426)
        at org.apache.zookeeper.server.quorum.FastLeaderElection.lookForLeader(FastLeaderElection.java:843)
        at org.apache.zookeeper.server.quorum.QuorumPeer.run(QuorumPeer.java:822)
2017-06-10 08:14:02,184 - INFO/0:0:0:0:0:0:0:0:2181:QuorumPeer$QuorumServer@149] - Resolved hostname: 192.168.86.134 to address: /192.168.86.134



Wyy_Ck 发表于 2017-6-10 23:13:14

我现在只能在每一个节点依次启动 后面会选择出lender follower等

参考的这个,不知道为啥不能整个集群直接启动

https://zhidao.baidu.com/question/456904981923784845.html
页: [1]
查看完整版本: 发一个zookeeper配置的错误