hadoop-zookeeper-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ted Dunning <ted.dunn...@gmail.com>
Subject Re: election recipe
Date Thu, 02 Sep 2010 22:40:53 GMT
You are correct that this simpler recipe will work for smaller populations
and correct that the complications are to avoid the herd effect.



On Thu, Sep 2, 2010 at 12:55 PM, Eric van Orsouw
<eric.van.orsouw@gmail.com>wrote:

> Hi there,
>
>
>
> I would like to use zookeeper to implement an election scheme.
>
> There is a recipe on the homepage, but it is relatively complex.
>
> I was wondering what was wrong with the following pseudo code;
>
>
>
> forever {
>
>    zookeeper.create -e /election <my_ip_address>
>
>    if creation succeeded then {
>
>        // do the leader thing
>
>    } else {
>
>        // wait for change in /election using watcher mechanism
>
>    }
>
> }
>
>
>
> My assumption is that the recipe is more elaborate to the eliminate the
> flood of requests if the leader falls away.
>
> But if there are only a handful of leader-candidates ,than that should not
> be a problem.
>
>
>
> Is this correct, or am I missing out on something.
>
>
>
> Thanks,
>
> Eric
>
>
>
>

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