Removing a ZooKeeper Role

Describes how to remove the ZooKeeper role from a node by using the CLI.

About this task

This procedure removes one ZooKeeper node from a previously installed cluster and uses rolling restarts to avoid cluster outages. If multiple ZooKeeper instances need to be removed, repeat this procedure from start to finish for each such ZooKeeper.

While it is possible to use a modified version of this procedure to remove multiple ZooKeepers at once, doing so involves more complexity and carries increased risk of creating a cluster outage if incorrect steps are followed.

Procedure

  1. On each node, identify the state of the ZooKeeper service:
    /opt/mapr/initscripts/zookeeper qstatus
    All previously installed ZooKeeper services, other than the one being removed, must be running and in either the leader or follower state. Do not proceed further if the ZooKeeper services are not in the expected state.
  2. On the node being removed, run the following command to stop ZooKeeper:
    service mapr-zookeeper stop
  3. On the node being removed, purge the mapr-zookeeper package.
  4. On all nodes in the cluster, run configure.sh with the following options:
    1. -Z: Specify all existing ZooKeeper nodes except the one being removed.
    2. -R: Specify this option to use all previously set configurations.
    For example:
    /opt/mapr/server/configure.sh -Z <all-nodes-excluding-removed-one> -R
    To identify the list of current ZooKeeper nodes in the cluster, run maprcli node listzookeepers.
  5. On the remaining nodes, perform a rolling restart of the ZooKeeper services. Use the following command to restart the ZooKeeper services:
    systemctl restart mapr-zookeeper
    For each remaining ZooKeeper node, one by one, restart the ZooKeeper service and then wait until its state is shown as either leader or follower before proceeding to the next node:
  6. Perform a rolling restart of Warden. On all nodes, run the following command to restart Warden:
    systemctl restart mapr-warden
  7. Run maprcli node listzookeepers. The output should show only the remaining ZooKeeper nodes.