zookeeper-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alvaro Gareppe <agare...@gmail.com>
Subject Re: Leader election in zookeeper
Date Wed, 13 Aug 2014 14:47:00 GMT
Taka a look into: <zookeeperfolder>/recipes/election in there you have a
leader election implementation.

The zookeepers server wont be part of the leader election of you service..
cause the idea is that you are selecting a leader to do some work.
Zookeeper also has a concept or leadership but that is internal of
zookeeper you dont need to take care of that.

If you take a look at that implementation then, after initializing
(creating connection and defining the node used for coodination), the only
thing you have to do is listen to the LeaderElectionAware event of the
LeaderElectionSupport class.


The idea behind that recipe is explained here:
http://zookeeper.apache.org/doc/trunk/recipes.html#sc_leaderElection

Other useful lib is that implements the leader election is "curator"



On Wed, Aug 13, 2014 at 5:46 AM, mufc_fan <rajeshkumarit8292@gmail.com>
wrote:

> I have 15 machines connected through a network. out of 15, zookeeper
> servers
> are running in three different machines and I have to select a leader for
> this distributed systems. My doubts are
>
> 1. For the election, 3 are zookeeper servers here so whether they also
> contest in this election.
> 2. How the election will be held. can u explain with each steps.
> 3. After electing a leader, how a node knows it is the leader.
> 4. Also can u explain how zookeeper co-ordinates this service simply.
>
>
>
>
> --
> View this message in context:
> http://zookeeper-user.578899.n2.nabble.com/Leader-election-in-zookeeper-tp7580147.html
> Sent from the zookeeper-user mailing list archive at Nabble.com.
>



-- 
Ing. Alvaro Gareppe
agareppe@gmail.com

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