With the new leader election, we require a third port. So, there is the
clientPort, there is the port servers use for communication upon regular
ZooKeeper operation, and a third port for leader election among the
ZooKeeper servers. The previous leader election algorithm used UDP, and the
regular communication among servers use TCP. Since the new leader election
uses TCP, we had the choice of either integrating leader election with the
regular quorum protocol, or to keep it separate and require another port
from each server. We kept them separate to simplify the implementation, but
we have been discussing merging them at some point. Once we merge, we'll
require one port, but it will take some restructuring of the code.
The figure you pointed out on the wiki reflects earlier versions of
ZooKeeper. It is probably a good idea to update, or at least clarify points
Hope it is clear now.
> -----Original Message-----
> From: mark harwood [mailto:[EMAIL PROTECTED]
> Sent: Thursday, August 28, 2008 11:55 AM
> To: firstname.lastname@example.org
> Subject: RE: Migrating from sourceforge 2.2.1 to Apache trunk -
> QuorumPeers failing to find each other
> >>Please use a port for electionPort different from the one you're using
> in the server configuration.
> I think I am getting confused with the range of port numbers that must be
> defined. I had assumed there were only 2 types - clientPort and
> electionPort representing the client-server comms and the server-server
> comms respectively as shown in the overview diagram below:
> It sounds like there may be another type of port to deal with - is this
> I previously added a comment about electionPorts to the Wiki documentation
> here ( http://zookeeper.wiki.sourceforge.net/ZooKeeperGettingStarted ) to
> clarify my understanding of the config settings.
> While this interpretation works OK in sourceforge 2.2.1 I am now confused
> as to the arrangement in Apache 3.0. I spent most of yesterday debugging
> and trying different configuration files. Sourceforge version worked fine
> but when I flipped the jars to the Apache version (keeping the same zoo
> config files) it just wouldn't work -either running on a single machine or
> multiples. Sometimes this was because the Apache version was using the
> wrong port to try talk to another machine (when I configured each server
> with different election port settings) and sometimes a single server would
> get a BindException trying to open the same ServerSocket twice.
> I suspect this may be down to my misunderstanding of the ports now used
> and a change since the sourceforge version. Can you cast any more light on
> I'd also be keen to get some advice on whether to go with sourceforge
> 2.2.1 or Apache 3.x for an upcoming deployment to a live system. I imagine
> ZK 3 may be a bit of a moving target but is more likely to get bug-fixed
> than zk 2.2.1?
> Many thanks,
> Send instant messages to your online friends http://uk.messenger.yahoo.com