zookeeper-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jérémie BORDIER <jeremie.bord...@gmail.com>
Subject Re: zookeeper leadership election example application
Date Mon, 28 Nov 2011 16:35:51 GMT
Here's the implementation in the HBase source repository that Ted pointed out:

http://svn.apache.org/viewvc/hbase/trunk/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKLeaderManager.java?view=markup

Jérémie

On Mon, Nov 28, 2011 at 5:29 PM, Olivier Van Acker
<cyberroadie@gmail.com> wrote:
>>
>>
>> failure modes.  This is the primary reason that I prefer the single file
>> leader election method.
>>
>
> What is single file leader election? A quick search on google didn't come
> up with any results :-(
>
> Olivier
>
>
>
>
>>
>> On Fri, Nov 25, 2011 at 10:17 PM, Jordan Zimmerman
>> <jzimmerman@netflix.com>wrote:
>>
>> > A few comments:
>> >
>> > * NodeMonitor.createRootIfNotExists() should catch NodeExists. In the
>> case
>> > of multiple clients, this is a possibility.
>> >
>> > * I'd add a start method and create the ZooKeeper instance there. This
>> > gives users a chance to set a listener so as to receive all messages.
>> >
>> > * All ZooKeeper operations should be in some kind of retry loop. The
>> > client can lose connection to a given server but successfully reconnect
>> to
>> > another one in the cluster.
>> >
>> > * When creating the Znode, it can succeed on the server but fail to
>> return
>> > the result to the client. On a Disconnect/Session exception, you should
>> > retry and then call getChildren and search for your node.
>> >
>> > -JZ
>> >
>> > On 11/25/11 2:45 AM, "Olivier Van Acker" <cyberroadie@gmail.com> wrote:
>> >
>> > >I've written a example app on how to do implement leadership election in
>> > >with zookeeper
>> > >Is there anyone on the list who'd like to review my app and if it needs
>> > >improvement or not?
>> > >
>> > >the app is on github:
>> > >https://github.com/cyberroadie/zookeeper-leader
>> > >
>> > >and explained how it works on my blog:
>> > >
>> >
>> http://cyberroadie.wordpress.com/2011/11/24/implementing-leader-election-w
>> > >ith-zookeeper/
>> > >
>> > >Olivier
>> >
>> >
>>
>



-- 
Jérémie 'ahFeel' BORDIER

Mime
View raw message