hadoop-zookeeper-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ted Dunning <ted.dunn...@gmail.com>
Subject Re: Problem with Zookeeper cluster configuration
Date Wed, 27 Oct 2010 17:17:45 GMT
Why 2?  Why not 3?

Even if this is just proof of concept, 2 servers is pretty weird.

That said your two instances should still be able to form a quorum.  Have
you done the standard tests of back and forth connectivity on the ports in
question?  Can you telnet to the ports?

Any chance you have left-over processes on those ports?

On Wed, Oct 27, 2010 at 6:21 AM, siddhartha banik <
siddhartha.banik@gmail.com> wrote:

> Hi,
>
> I am trying to configure zookeeper cluster ... with 2 server instances.
> zookeeper version : 3.2.2
>
> Config files are :
>
> *Server 1. zoo.cfg*
>
> tickTime=2000
> initLimit=10
> syncLimit=5
> dataDir=/home/xuser/zookeeper1/zookeeper-3.2.2/data/
> clientPort=5181
> server.1=3.7.192.142:5181:5888
> server.2=3.7.192.145:5181:5888
>
> *Server 2. zoo.cfg*
>
> tickTime=2000
> initLimit=10
> syncLimit=5
> dataDir=/home/xuser/zookeeper2/zookeeper-3.2.2/data/
> clientPort=5181
> server.1=3.7.192.142:5181:5888
> server.2=3.7.192.145:5181:5888
>
> I have also created "*myid*" files in respective data folders. Below are
> the
> exception I am seeing :
>
> *Server 1*
>
> 2010-10-27 07:43:43,411 - INFO  [QuorumPeer:/0.0.0.0:5181:QuorumPeer@514]
> -
> LOOKING
> 2010-10-27 07:43:43,418 - INFO  [QuorumPeer:/0.0.0.0:5181
> :FastLeaderElection@579] - New election: -1
> 2010-10-27 07:43:43,419 - INFO  [QuorumPeer:/0.0.0.0:5181
> :FastLeaderElection@618] - Notification: 1, -1, 382, 1, LOOKING, LOOKING,
> 1
> 2010-10-27 07:43:43,420 - INFO  [QuorumPeer:/0.0.0.0:5181
> :FastLeaderElection@642] - Adding vote
> 2010-10-27 07:43:43,436 - INFO  [QuorumPeer:/0.0.0.0:5181
> :FastLeaderElection@618] - Notification: 2, 0, 383, 1, LOOKING, LOOKING, 2
> 2010-10-27 07:43:43,442 - INFO  [QuorumPeer:/0.0.0.0:5181
> :FastLeaderElection@642] - Adding vote
> 2010-10-27 07:43:43,443 - INFO  [QuorumPeer:/0.0.0.0:5181
> :FastLeaderElection@618] - Notification: 2, 0, 383, 1, LOOKING, LOOKING, 1
> 2010-10-27 07:43:43,443 - INFO  [QuorumPeer:/0.0.0.0:5181
> :FastLeaderElection@642] - Adding vote
> 2010-10-27 07:43:43,444 - INFO  [QuorumPeer:/0.0.0.0:5181:QuorumPeer@523]
> -
> FOLLOWING
> 2010-10-27 07:43:43,445 - INFO  [QuorumPeer:/0.0.0.0:5181
> :ZooKeeperServer@160] - Created server
> 2010-10-27 07:43:43,447 - INFO  [QuorumPeer:/0.0.0.0:5181:Follower@147] -
> Following /3.7.192.145:5181
> 2010-10-27 07:43:43,461 - INFO  [WorkerReceiver
> Thread:FastLeaderElection$Messenger$WorkerReceiver@254] - Sending new
> notification.
> 2010-10-27 07:43:43,462 - WARN  [QuorumPeer:/0.0.0.0:5181:Follower@318] -
> Exception when following the leader
> java.io.EOFException
>        at java.io.DataInputStream.readInt(DataInputStream.java:375)
>        at
> org.apache.jute.BinaryInputArchive.readInt(BinaryInputArchive.java:63)
>        at
>
> org.apache.zookeeper.server.quorum.QuorumPacket.deserialize(QuorumPacket.java:66)
>        at
> org.apache.jute.BinaryInputArchive.readRecord(BinaryInputArchive.java:108)
>        at
> org.apache.zookeeper.server.quorum.Follower.readPacket(Follower.java:114)
>        at
> org.apache.zookeeper.server.quorum.Follower.followLeader(Follower.java:193)
>        at
> org.apache.zookeeper.server.quorum.QuorumPeer.run(QuorumPeer.java:525)
> 2010-10-27 07:43:43,464 - INFO  [QuorumPeer:/0.0.0.0:5181:Follower@436] -
> shutdown called
> java.lang.Exception: shutdown Follower
>        at
> org.apache.zookeeper.server.quorum.Follower.shutdown(Follower.java:436)
>        at
> org.apache.zookeeper.server.quorum.QuorumPeer.run(QuorumPeer.java:529)
>
> *Server 2
>
> *010-10-27 07:59:22,387 - INFO  [QuorumPeer:/0.0.0.0:5181:QuorumPeer@535]
> -
> LEADING
> 2010-10-27 07:59:22,388 - INFO  [QuorumPeer:/0.0.0.0:5181
> :ZooKeeperServer@160] - Created server
> 2010-10-27 07:59:22,390 - ERROR [QuorumPeer:/0.0.0.0:5181:Leader@127] -
> Couldn't bind to port 5181
> java.net.BindException: Address already in use
>        at java.net.PlainSocketImpl.socketBind(Native Method)
>        at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:359)
>        at java.net.ServerSocket.bind(ServerSocket.java:319)
>        at java.net.ServerSocket.<init>(ServerSocket.java:185)
>        at java.net.ServerSocket.<init>(ServerSocket.java:97)
>        at org.apache.zookeeper.server.quorum.Leader.<init>(Leader.java:125)
>        at
>
> org.apache.zookeeper.server.quorum.QuorumPeer.makeLeader(QuorumPeer.java:417)
>        at
> org.apache.zookeeper.server.quorum.QuorumPeer.run(QuorumPeer.java:537)
> 2010-10-27 07:59:22,392 - WARN  [QuorumPeer:/0.0.0.0:5181:QuorumPeer@541]
> -
> Unexpected exception
> java.net.BindException: Address already in use
>        at java.net.PlainSocketImpl.socketBind(Native Method)
>        at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:359)
>        at java.net.ServerSocket.bind(ServerSocket.java:319)
>        at java.net.ServerSocket.<init>(ServerSocket.java:185)
>        at java.net.ServerSocket.<init>(ServerSocket.java:97)
>        at org.apache.zookeeper.server.quorum.Leader.<init>(Leader.java:125)
>        at
>
> org.apache.zookeeper.server.quorum.QuorumPeer.makeLeader(QuorumPeer.java:417)
>        at
> org.apache.zookeeper.server.quorum.QuorumPeer.run(QuorumPeer.java:537)
> 2010-10-27 07:59:22,393 - INFO  [WorkerReceiver
> Thread:FastLeaderElection$Messenger$WorkerReceiver@254] - Sending new
> notification.
> 2010-10-27 07:59:22,394 - INFO  [QuorumPeer:/0.0.0.0:5181:QuorumPeer@514]
> -
> LOOKING*
> *
>
> I have tried with netstat command also. No other process is using *5181
> *port
> other then zookeeper process.
>
> Other thing I have tried is: using separate ports for server1 & server 2.
> Surprise is after starting server 2, server 1 also starts to use the same
> port as server 2 is using as client port. Does that matter , as server1 &
> server 2 are running in different boxes.
>
> Any help is appreciated.
>
>
> Thanks
> Siddhartha
>

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