Joining new ZooKeeper nodes to the existing nodes

After you install ZooKeeper and Watchdog, you must join the new ZooKeeper nodes to the existing nodes.

In ZooKeeper, all nodes are part of a global ensemble and have a quorum in the ensemble. To join new ZooKeeper nodes, configuration changes must be made in all new and existing ZooKeeper nodes.

To join a ZooKeeper node to existing nodes, complete the following steps:

  1. On each of the existing ZooKeeper nodes, run the following command: echo stat | nc localhost 2181 | grep Mode.

    If you specified a different port number during installation, replace 2181 with that port number.

    If the Mode shows Leader, skip the node and go to the next node. When the Mode shows Follower, complete the following steps:

    1. Stop ZooKeeper and Watchdog.
    2. Edit the zoo.cfg file and add the server.<n> definitions for all the ZooKeeper nodes in the new data center.
    3. Start ZooKeeper and Watchdog.
  2. After you modify the Follower nodes, complete the following steps on the Leader node:
    1. Stop ZooKeeper and Watchdog.
    2. Edit the zoo.cfg file and add the server.<n> definitions for all the ZooKeeper nodes in the new data center.
    3. Start ZooKeeper and Watchdog.
    A new ZooKeeper leader is selected.