You can do this. We only done preliminary testing with that configuration. You
may need to increase the tickTime if the pipe between A and B has high
latency and you start seeing timeouts.
There is a bit of a gotcha that you need to keep in mind. Currently clients
select servers at random to
The client library is in charge of preventing expirations, if it happens it is
probably because of dead servers or network problems that caused a spike in
latency.
Increasing your session timeout helps prevent this.
If/when it happens, you need create another ZooKeeper object to reconnect to
Good point. The recipe we show guarantees there will be a single leader
elected, but only the leader knows it. Jacob Levy has been implementing a
client library to do leader election, so he should really chime in here, but
just in case he doesn't: I believe Jacob's solution was for the leader
Ben described the general outline of the protocol we implemented, which
is an improvement on the recipe to avoid a herd effect every time that
the leader changed. This improvement was actually suggested by Runping
Qi of Yahoo!. The recipe protocol requires all clients to recomputed if
they are now