开发者

Zookeeper Node strategy to pick up the leader?

Suppose I have 5 node configuration in the Zookeeper {1,2,3,4,5} Zookeeper says that a leader is elected w开发者_如何学编程hen 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!


There are some notes here.

Each node votes for itself initially. For succeeding rounds, each node votes for the node with the highest zxid (latest transaction) with ties being broken by highest nodeid.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜