zookeeper-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Frank Zheng <bearzheng2...@gmail.com>
Subject Re: Cannot Open Channel at Election Address
Date Mon, 08 Oct 2012 03:03:59 GMT
I find the problem.
The IP Address of my computer changed !

On Mon, Oct 8, 2012 at 10:11 AM, Frank Zheng <bearzheng2011@gmail.com>wrote:

> I rechecked myid files. There was no problem.
> And the error messages displayed after I had started all servers.
>
> In one machine, the error messages are as follows.
>
> 2012-10-08 18:06:29,261 [myid:2] - WARN
> [QuorumPeer[myid=2]/0:0:0:0:0:0:0:0:2182:QuorumCnxManager@368] - Cannot
> open channel to 3 at election address testing.machine1/192.168.0.101:3902
>
> java.net.ConnectException: Connection refused
>     at java.net.PlainSocketImpl.socketConnect(Native Method)
>     at
> java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:327)
>     at
> java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:193)
>     at
> java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:180)
>     at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:384)
>     at java.net.Socket.connect(Socket.java:546)
>     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)
> 2012-10-08 18:06:29,262 [myid:2] - INFO
> [QuorumPeer[myid=2]/0:0:0:0:0:0:0:0:2182:QuorumCnxManager@190] - Have
> smaller server identifier, so dropping the connection: (4, 2)
> 2012-10-08 18:06:29,262 [myid:2] - INFO
> [QuorumPeer[myid=2]/0:0:0:0:0:0:0:0:2182:FastLeaderElection@774] -
> Notification time out: 60000
>
> In the other machine, the error messages are like this.
>
> 2012-10-08 10:08:37,076 [myid:5] - WARN
> [WorkerSender[myid=5]:QuorumCnxManager@368] - Cannot open channel to 3 at
> election address testing.machine1/192.168.0.101:3902
>
> java.net.ConnectException: Connection refused
>     at java.net.PlainSocketImpl.socketConnect(Native Method)
>     at
> java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:327)
>     at
> java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:193)
>     at
> java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:180)
>     at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:384)
>     at java.net.Socket.connect(Socket.java:546)
>     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:679)
> 2012-10-08 10:08:37,079 [myid:5] - INFO
> [WorkerReceiver[myid=5]:FastLeaderElection@542] - Notification: 5
> (n.leader), 0x0 (n.zxid), 0x1 (n.round), LOOKING (n.state), 4 (n.sid), 0x0
> (n.peerEPoch), LOOKING (my state)
> 2012-10-08 10:08:37,079 [myid:5] - INFO
> [WorkerReceiver[myid=5]:FastLeaderElection@542] - Notification: 5
> (n.leader), 0x0 (n.zxid), 0x1 (n.round), LOOKING (n.state), 5 (n.sid), 0x0
> (n.peerEPoch), LOOKING (my state)
>
>
> These two kinds of error messages keep showing again and again.
> When I tried to set up a client and connect on server, an error came up.
>
> [root@testing zookeeper-3.4.4]# bin/zkCli.sh -server testing.machine2:2184
> Connecting to testing.machine2:2184
> 2012-10-08 10:10:38,734 [myid:] - INFO  [main:Environment@100] - Client
> environment:zookeeper.version=3.4.4-1386507, built on 09/17/2012 08:33 GMT
> 2012-10-08 10:10:38,737 [myid:] - INFO  [main:Environment@100] - Client
> environment:host.name=testing.machine2
> 2012-10-08 10:10:38,737 [myid:] - INFO  [main:Environment@100] - Client
> environment:java.version=1.6.0_22
> 2012-10-08 10:10:38,737 [myid:] - INFO  [main:Environment@100] - Client
> environment:java.vendor=Sun Microsystems Inc.
> 2012-10-08 10:10:38,738 [myid:] - INFO  [main:Environment@100] - Client
> environment:java.home=/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre
> 2012-10-08 10:10:38,738 [myid:] - INFO  [main:Environment@100] - Client
> environment:java.class.path=/usr/zookeeper-3.4.4/bin/../build/classes:/usr/zookeeper-3.4.4/bin/../build/lib/*.jar:/usr/zookeeper-3.4.4/bin/../lib/slf4j-log4j12-1.6.1.jar:/usr/zookeeper-3.4.4/bin/../lib/slf4j-api-1.6.1.jar:/usr/zookeeper-3.4.4/bin/../lib/netty-3.2.2.Final.jar:/usr/zookeeper-3.4.4/bin/../lib/log4j-1.2.15.jar:/usr/zookeeper-3.4.4/bin/../lib/jline-0.9.94.jar:/usr/zookeeper-3.4.4/bin/../zookeeper-3.4.4.jar:/usr/zookeeper-3.4.4/bin/../src/java/lib/*.jar:/usr/zookeeper-3.4.4/bin/../conf:
> 2012-10-08 10:10:38,738 [myid:] - INFO  [main:Environment@100] - Client
> environment:java.library.path=/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/amd64/server:/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/amd64:/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/../lib/amd64:/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
> 2012-10-08 10:10:38,738 [myid:] - INFO  [main:Environment@100] - Client
> environment:java.io.tmpdir=/tmp
> 2012-10-08 10:10:38,739 [myid:] - INFO  [main:Environment@100] - Client
> environment:java.compiler=<NA>
> 2012-10-08 10:10:38,739 [myid:] - INFO  [main:Environment@100] - Client
> environment:os.name=Linux
> 2012-10-08 10:10:38,739 [myid:] - INFO  [main:Environment@100] - Client
> environment:os.arch=amd64
> 2012-10-08 10:10:38,739 [myid:] - INFO  [main:Environment@100] - Client
> environment:os.version=2.6.32-220.el6.x86_64
> 2012-10-08 10:10:38,740 [myid:] - INFO  [main:Environment@100] - Client
> environment:user.name=root
> 2012-10-08 10:10:38,740 [myid:] - INFO  [main:Environment@100] - Client
> environment:user.home=/root
> 2012-10-08 10:10:38,740 [myid:] - INFO  [main:Environment@100] - Client
> environment:user.dir=/usr/zookeeper-3.4.4
> 2012-10-08 10:10:38,741 [myid:] - INFO  [main:ZooKeeper@433] - Initiating
> client connection, connectString=testing.machine2:2184 sessionTimeout=30000
> watcher=org.apache.zookeeper.ZooKeeperMain$MyWatcher@657d5d2a
> Welcome to ZooKeeper!
> 2012-10-08 10:10:38,768 [myid:] - INFO
> [main-SendThread(testing.machine2:2184):ClientCnxn$SendThread@966] -
> Opening socket connection to server testing.machine2/192.168.0.103:2184.
> Will not attempt to authenticate using SASL (unknown error)
> JLine support is enabled
> 2012-10-08 10:10:38,773 [myid:] - INFO
> [main-SendThread(testing.machine2:2184):ClientCnxn$SendThread@849] -
> Socket connection established to testing.machine2/192.168.0.103:2184,
> initiating session
> 2012-10-08 10:10:38,789 [myid:] - INFO
> [main-SendThread(testing.machine2:2184):ClientCnxn$SendThread@1085] -
> Unable to read additional data from server sessionid 0x0, likely server has
> closed socket, closing socket connection and attempting reconnect
> [zk: testing.machine2:2184(CONNECTING) 0] 2012-10-08 10:10:40,879 [myid:]
> - INFO  [main-SendThread(testing.machine2:2184):ClientCnxn$SendThread@966]
> - Opening socket connection to server testing.machine2/192.168.0.103:2184.
> Will not attempt to authenticate using SASL (unknown error)
> 2012-10-08 10:10:40,881 [myid:] - INFO
> [main-SendThread(testing.machine2:2184):ClientCnxn$SendThread@849] -
> Socket connection established to testing.machine2/192.168.0.103:2184,
> initiating session
> 2012-10-08 10:10:40,884 [myid:] - INFO
> [main-SendThread(testing.machine2:2184):ClientCnxn$SendThread@1085] -
> Unable to read additional data from server sessionid 0x0, likely server has
> closed socket, closing socket connection and attempting reconnect
> 2012-10-08 10:10:42,418 [myid:] - INFO
> [main-SendThread(testing.machine2:2184):ClientCnxn$SendThread@966] -
> Opening socket connection to server testing.machine2/192.168.0.103:2184.
> Will not attempt to authenticate using SASL (unknown error)
> 2012-10-08 10:10:42,419 [myid:] - INFO
> [main-SendThread(testing.machine2:2184):ClientCnxn$SendThread@849] -
> Socket connection established to testing.machine2/192.168.0.103:2184,
> initiating session
> 2012-10-08 10:10:42,422 [myid:] - INFO
> [main-SendThread(testing.machine2:2184):ClientCnxn$SendThread@1085] -
> Unable to read additional data from server sessionid 0x0, likely server has
> closed socket, closing socket connection and attempting reconnect
>
>
>
> On Sat, Oct 6, 2012 at 10:25 PM, Patrick Hunt <phunt@apache.org> wrote:
>
>> Were those the early error messages, or after you had started all
>> servers and waited a bit? I'd suggest you start them all, then tail
>> one of the logs and see what's going on once everyone is started.
>> Ensure that you have the "myid" files correct - that each server has a
>> distinct server id.
>>
>> Not sure it will help but try this? (specify count as 5)
>> https://github.com/phunt/zkconf
>>
>> Patrick
>>
>> On Fri, Oct 5, 2012 at 3:03 AM, Frank Zheng <bearzheng2011@gmail.com>
>> wrote:
>> > Hi All,
>> >
>> > I tried to set up a multi-server cluster in two machines, following the
>> > instructions on the website.
>> > I set up 5 servers (named 1~5) in two machines. The configuration is as
>> > follows.
>> >
>> > tickTime=2000
>> > initLimit=10
>> > syncLimit=5
>> > clientPort=2181
>> > dataDir=/var/zookeeper/1
>> >
>> > server.1=testing.machine1:2900:3900
>> > server.2=testing.machine1:2901:3901
>> > server.3=testing.machine1:2902:3902
>> > server.4=testing.machine2:2903:3903
>> > server.5=testing.machine2:2904:3904
>> >
>> >
>> > When I set up the cluster, there was a problem in all the five servers.
>> >
>> >
>> > 2012-10-05 17:51:43,555 [myid:1] - WARN
>> > [QuorumPeer[myid=1]/0:0:0:0:0:0:0:0:2181:QuorumCnxManager@368] - Cannot
>> > open channel to 2 at election address testing.machine1/
>> 192.168.0.101:3901
>> > java.net.ConnectException: Connection refused
>> >     at java.net.PlainSocketImpl.socketConnect(Native Method)
>> >     at
>> >
>> java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:327)
>> >     at
>> >
>> java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:193)
>> >     at
>> >
>> java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:180)
>> >     at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:384)
>> >     at java.net.Socket.connect(Socket.java:546)
>> >     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)
>> > 2012-10-05 17:51:43,556 [myid:1] - WARN
>> > [QuorumPeer[myid=1]/0:0:0:0:0:0:0:0:2181:QuorumCnxManager@368] - Cannot
>> > open channel to 3 at election address testing.machine1/
>> 192.168.0.101:3902
>> > java.net.ConnectException: Connection refused
>> >     at java.net.PlainSocketImpl.socketConnect(Native Method)
>> >     at
>> >
>> java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:327)
>> >     at
>> >
>> java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:193)
>> >     at
>> >
>> java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:180)
>> >     at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:384)
>> >     at java.net.Socket.connect(Socket.java:546)
>> >     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)
>> > 2012-10-05 17:51:43,557 [myid:1] - INFO
>> > [QuorumPeer[myid=1]/0:0:0:0:0:0:0:0:2181:QuorumCnxManager@190] - Have
>> > smaller server identifier, so dropping the connection: (4, 1)
>> > 2012-10-05 17:51:43,558 [myid:1] - INFO
>> > [QuorumPeer[myid=1]/0:0:0:0:0:0:0:0:2181:FastLeaderElection@774] -
>> > Notification time out: 60000
>> >
>> >
>> > I tried in zookeeper-3.3.6 and zookeeper-3.4.4, and got the same
>> problem.
>> > Could anyone help me?
>> >
>> > Thanks
>> > Frank
>>
>
>
>
> --
> Sincerely,
> Zheng Yu
> Mobile:  (852) 60670059
> Email:    bearzheng2011@gmail.com
>
>
>
>


-- 
Sincerely,
Zheng Yu
Mobile:  (852) 60670059
Email:    bearzheng2011@gmail.com

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message