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
- On each node, identify the state of the ZooKeeper
service:
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./opt/mapr/initscripts/zookeeper qstatus
- On the node being removed, run the following command to stop
ZooKeeper:
service mapr-zookeeper stop
- On the node being removed, purge the
mapr-zookeeper
package. - On all nodes in the cluster, run configure.sh
with the following options:
-Z
: Specify all existing ZooKeeper nodes except the one being removed.-R
: Specify this option to use all previously set configurations.
To identify the list of current ZooKeeper nodes in the cluster, run/opt/mapr/server/configure.sh -Z <all-nodes-excluding-removed-one> -R
maprcli node listzookeepers
. - On the remaining nodes, perform a rolling restart of the ZooKeeper services.
Use the following command to restart the ZooKeeper
services:
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:systemctl restart mapr-zookeeper
- Perform a rolling restart of Warden. On all nodes, run the following command
to restart Warden:
systemctl restart mapr-warden
- Run
maprcli node listzookeepers
. The output should show only the remaining ZooKeeper nodes.