Zookeeper一直提示连接失败
Zookeeper一直提示连接失败,已经检查几遍了。还是查不出原因,请教各位大牛们?以下是 zoo.cfg配置
dataDir=/opt/src/zookeeper-3.4.7/data
dataLogDir=/opt/src/zookeeper-3.4.7/logs
# 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.purgeInterval=1
server.1=n1:2888:3888
server.2=s1:2888:3888
server.3=S2:2888:3888
server.1=n1:2888:3888
server.2=s1:2888:3888
server.3=S2:2888:3888
三个会竞争端口,导致链接不上。端口可一直递增。
server.1=n1:2888:3888
server.2=s1:2889:3889
server.3=S2:2890:3890
bioger_hit 发表于 2016-3-24 16:59
server.1=n1:2888:3888
server.2=s1:2888:3888
server.3=S2:2888:3888
您好!按你的方法改了并测试,好像还是不行.错误如下
2016-03-24 12:17:39,696 - INFO - Reading configuration from: /opt/src/zookeeper-3.4.5/bin/../conf/zoo.cfg
2016-03-24 12:17:39,707 - INFO - Defaulting to majority quorums
2016-03-24 12:17:39,772 - INFO - autopurge.snapRetainCount set to 3
2016-03-24 12:17:39,773 - INFO - autopurge.purgeInterval set to 0
2016-03-24 12:17:39,774 - INFO - Purge task is not scheduled.
2016-03-24 12:17:39,796 - INFO - Starting quorum peer
2016-03-24 12:17:39,974 - INFO - binding to port 0.0.0.0/0.0.0.0:2181
2016-03-24 12:17:40,009 - INFO - tickTime set to 2000
2016-03-24 12:17:40,009 - INFO - minSessionTimeout set to -1
2016-03-24 12:17:40,010 - INFO - maxSessionTimeout set to -1
2016-03-24 12:17:40,010 - INFO - initLimit set to 10
2016-03-24 12:17:40,035 - INFO - currentEpoch not found! Creating with a reasonable default of 0. This should only happen when you are upgrading your installation
2016-03-24 12:17:40,079 - INFO - acceptedEpoch not found! Creating with a reasonable default of 0. This should only happen when you are upgrading your installation
2016-03-24 12:17:40,091 - INFO - My election bind port: 0.0.0.0/0.0.0.0:3888
2016-03-24 12:17:40,186 - INFO/0:0:0:0:0:0:0:0:2181:QuorumPeer@670] - LOOKING
2016-03-24 12:17:40,188 - INFO/0:0:0:0:0:0:0:0:2181:FastLeaderElection@740] - New election. My id =1, proposed zxid=0x0
2016-03-24 12:17:40,204 - INFO:FastLeaderElection@542] - Notification: 1 (n.leader), 0x0 (n.zxid), 0x1 (n.round), LOOKING (n.state), 1 (n.sid), 0x0 (n.peerEPoch), LOOKING (my state)
2016-03-24 12:17:41,296 - INFO - Accepted socket connection from /127.0.0.1:56833
2016-03-24 12:17:41,303 - INFO - Processing srvr command from /127.0.0.1:56833
2016-03-24 12:17:41,307 - INFO - Closed socket connection for client /127.0.0.1:56833 (no session established for client)
2016-03-24 12:17:43,266 - WARN:QuorumCnxManager@368] - Cannot open channel to 2 at election address S1/192.168.253.132:3889
java.net.NoRouteToHostException: No route to host
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:354)
at org.apache.zookeeper.server.quorum.QuorumCnxManager.toSend(QuorumCnxManager.java:327)
at org.apache.zookeeper.server.quorum.FastLeaderElection$Messenger$WorkerSender.process(FastLeaderElection.java:393)
at org.apache.zookeeper.server.quorum.FastLeaderElection$Messenger$WorkerSender.run(FastLeaderElection.java:365)
at java.lang.Thread.run(Thread.java:745)
2016-03-24 12:17:46,227 - WARN/0:0:0:0:0:0:0:0:2181:QuorumCnxManager@368] - Cannot open channel to 2 at election address S1/192.168.253.132:3889
java.net.NoRouteToHostException: No route to host
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:354)
at org.apache.zookeeper.server.quorum.QuorumCnxManager.connectAll(QuorumCnxManager.java:388)
at org.apache.zookeeper.server.quorum.FastLeaderElection.lookForLeader(FastLeaderElection.java:765)
at org.apache.zookeeper.server.quorum.QuorumPeer.run(QuorumPeer.java:716)
2016-03-24 12:17:46,243 - INFO/0:0:0:0:0:0:0:0:2181:FastLeaderElection@774] - Notification time out: 400
2016-03-24 12:17:49,245 - WARN:QuorumCnxManager@368] - Cannot open channel to 3 at election address S2/192.168.253.133:3890
java.net.NoRouteToHostException: No route to host
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:354)
at org.apache.zookeeper.server.quorum.QuorumCnxManager.toSend(QuorumCnxManager.java:327)
at org.apache.zookeeper.server.quorum.FastLeaderElection$Messenger$WorkerSender.process(FastLeaderElection.java:393)
at org.apache.zookeeper.server.quorum.FastLeaderElection$Messenger$WorkerSender.run(FastLeaderElection.java:365)
at java.lang.Thread.run(Thread.java:745)
2016-03-24 12:17:52,254 - WARN/0:0:0:0:0:0:0:0:2181:QuorumCnxManager@368] - Cannot open channel to 2 at election address S1/192.168.253.132:3889
java.net.NoRouteToHostException: No route to host
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:354)
at org.apache.zookeeper.server.quorum.QuorumCnxManager.connectAll(QuorumCnxManager.java:388)
at org.apache.zookeeper.server.quorum.FastLeaderElection.lookForLeader(FastLeaderElection.java:765)
at org.apache.zookeeper.server.quorum.QuorumPeer.run(QuorumPeer.java:716)
神豪。 发表于 2016-3-24 19:55
您好!按你的方法改了并测试,好像还是不行.错误如下
2016-03-24 12:17:39,696 - INFO
应该是防火墙的原因
atsky123 发表于 2016-3-24 22:27
应该是防火墙的原因
您好!防火墙我第一时间就关闭了!以下是我配置的图片. hosts配置完以后也没有动过了
神豪。 发表于 2016-3-25 09:17
您好!防火墙我第一时间就关闭了!以下是我配置的图片. hosts配置完以后也没有动过了
为何端口还没有改过来
atsky123 发表于 2016-3-25 10:20
为何端口还没有改过来
上次改过来也暴错了,就还原了。大神你QQ多少细聊
楼主 不是一个错误,建议多参考几个文档。
server.1=n1:2888:3888
server.2=s1:2888:3888
server.3=S2:2888:3888
三个节点应该是3台主机吧,同一台主机,就要改2888:3888这两个端口;3台主机就不需要改.
在另外两台主机上看是否能telnet n1 2888 / 3888 / 2181,如果telnet过不去,应该是防火墙的原因了
根据日志初步分析是端口不通, szcountryboy 发表于 2016-3-31 15:54
server.1=n1:2888:3888
server.2=s1:2888:3888
server.3=S2:2888:3888
搞定了。 直接用ip就ok了
页:
[1]