Skip to main content
Big-dAta
Silver ⭐️⭐️
August 9, 2022
Solved

Zookeeper leader election

if I have 5 zookeeper nodes and from that 5 zookeeper nodes one 1 zookeeper nodes goes down which was leader node then how zookeeper will elect the new leader from the remaining 4 zookeeper node?

araujo
araujoAnswer
Platinum ⭐️⭐️⭐️
August 9, 2022

@Big-dAta ,

 

A quorum in a ZooKeeper ensemble is a group of servers with more than half of the total number of servers in the ensemble. So for an ensemble of 5 servers, the quorum is 3 servers.

 

As long as there are 3 servers available an election can always be carried out.

So, in your example, the 4 remaining servers will talk to each other and decide who will be the new leader.

 

Cheers,

André

 

-- Was your question answered? Please take some time to click on "Accept as Solution" below this post. If you find a reply useful, say thanks by clicking on the thumbs up button.

3 replies

araujo
Platinum ⭐️⭐️⭐️
araujoAnswer
Platinum ⭐️⭐️⭐️
August 9, 2022

@Big-dAta ,

 

A quorum in a ZooKeeper ensemble is a group of servers with more than half of the total number of servers in the ensemble. So for an ensemble of 5 servers, the quorum is 3 servers.

 

As long as there are 3 servers available an election can always be carried out.

So, in your example, the 4 remaining servers will talk to each other and decide who will be the new leader.

 

Cheers,

André

 

Translate
-- Was your question answered? Please take some time to click on "Accept as Solution" below this post. If you find a reply useful, say thanks by clicking on the thumbs up button.
Big-dAta
Big-dAtaAuthor
Silver ⭐️⭐️
August 10, 2022

Thank you mate, & what if 3 of my zookeeper are down? What I can do at that time 

 

 

 

Translate
araujo
Platinum ⭐️⭐️⭐️
Platinum ⭐️⭐️⭐️
August 10, 2022

Then the service will be unavailable until you recover at least one of them.

Translate
-- Was your question answered? Please take some time to click on "Accept as Solution" below this post. If you find a reply useful, say thanks by clicking on the thumbs up button.