Currently, you cannot dynamically change the configuration of a zookeeper cluster without restarting it. There is an open problem to fix this, ZOOKEEPER-107 . The document describing the cluster membership algorithm is very interesting and can be found.
You can change the cluster configuration by restarting server nodes 1 at a time. For example, if the cluster has servers A, B, C, and you want to replace server C with D, you can do something like
- Reset C
- Raise D, peer list - A, B, D
- Remove B
- Change convolution list B to A, B, D
- Connect B
- A A, B, D
- A
- , A, B, D
t = t_1 zookeeper. , node , ( (N/2) + 1), . zookeeper .
, , ,
peer-3 , peer-3.
, node zookeeper , , , . , , , , , , . leaderServes, , .