You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by Apache Wiki <wi...@apache.org> on 2008/11/11 21:27:33 UTC

[Hadoop Wiki] Update of "ZooKeeper/ZooKeeperExercise2" by BenjaminReed

Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Hadoop Wiki" for change notification.

The following page has been changed by BenjaminReed:
http://wiki.apache.org/hadoop/ZooKeeper/ZooKeeperExercise2

New page:
Use what you learned from the previous exercise to implement the simple leader election:

{{{
    getData(“.../cluster1/leader”, true)‏
    if successful follow the leader described in the data and exit
    create(“.../cluster1/leader”, hostname, EPHEMERAL)‏
    if successful lead and exit
    goto step 1
}}}

Be sure to use the watch event to watch for the leader going away.

Once you have this implemented lets try testing by killing the client that is the leader. Does everything fail over correctly?

What happens if there is a communication error during the create? Are you handling it correctly? (Probably not :)