zookeeper-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Flavio Junqueira <...@yahoo-inc.com>
Subject Re: Zookeeper Node strategy to pick up the leader?
Date Sun, 24 Jul 2011 20:30:00 GMT
Leader selection is not random, but based on the last transaction  
acknowledged. Peers vote for the one with highest zxid (server ids  
break ties) and leave election once they hear the same vote from a  
quorum. If everything goes well, a quorum supports the new leader and  
system is able to make progress.


On Jul 24, 2011, at 10:02 PM, Chiku Singh wrote:

> Suppose I have 5 node configuration in the Zookeeper {1,2,3,4,5}  
> Zookeeper
> says that a leader is elected when a majority of nodes vote for any  
> given
> node then, the node having majority of nodes is selected as the  
> leader.
> Zookeeper benchmark says that a leader election typically takes 200  
> ms.
> My question is how is the convergence achieved?
> Do all nodes start voting for the node 1 as the leader or they start
> selecting the leader randomly? If the appointment of leader is totally
> random then how does it ensure convergence or such fast rates of  
> leader
> election?
> Thanks for the answer! Help appreciated!


research scientist

direct +34 93-183-8828

avinguda diagonal 177, 8th floor, barcelona, 08018, es
phone (408) 349 3300    fax (408) 349 3301

View raw message