zookeeper-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eric van Orsouw" <eric.van.ors...@gmail.com>
Subject election recipe
Date Thu, 02 Sep 2010 19:55:39 GMT
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