Differences between revisions 1 and 2
Revision 1 as of 2008-11-11 20:27:30
Size: 649
Editor: BenjaminReed
Comment:
Revision 2 as of 2009-09-20 23:54:19
Size: 649
Editor: localhost
Comment: converted to 1.6 markup
No differences found!

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 :)

ZooKeeper/ZooKeeperExercise2 (last edited 2009-09-20 23:54:19 by localhost)