A rolling update works very well for that. You can also change the number
of nodes in the cluster.
To do this, you replace the config files on the surviving servers and on the
Then take down the one that is leaving the cluster and then one by one
restart the servers that will remain in the cluster. Then start the new
If you only have 3 ZK servers, you might want to do the upgrade in two steps
if you are totally paranoid about running with just 2 servers in your
cluster. In that scenario, you would add the new server to the config and
restart each of the 3 ZK servers and staring the new one. That gives you a
ZK cluster with 4 servers. Another rolling update can reconfigure it to
have only the 3 servers you want.
Make sure you leave several seconds between restarting each server. That
will give the cluster time to calm down and do any necessary leader
On Sun, Jun 28, 2009 at 11:03 PM, Qian Ye <yeqian....@gmail.com> wrote:
> A related question. If I have run a Zookeeper service with many ephemeral
> znodes on five servers, then I want to replace one of the servers by a new
> one, and the new server has a new IP. How can I do the job without any loss
> of data ?