Replace a ZooKeeper role without ZooKeeper service downtime

If server to server SASL Authentication is not enabled, you can replace a ZooKeeper role without ZooKeeper service downtime.

This process if valid only if the SASL authentication is not enabled between the ZooKeeper servers. You can check this in Cloudera Manager, if you check the Enable Server to Server SASL Authentication under the Configuration of ZooKeeper.

  1. In Cloudera Manager, select the ZooKeeper service.
  2. Click the Instances tab.
  3. Select the ZooKeeper role on the old host.
  4. Click the Actions for Selected button.
  5. Select Stop.
  6. Wait 1 minute.
  7. Click the Status tab.
  8. Confirm that ZooKeeper service elected one of the remaining hosts as a leader.
  9. Click the Instances tab.
  10. Click the Add Role Instances button.
  11. Select the new host.
  12. Click Continue.
  13. Confirm the changes.
  14. Click Continue.
  15. Click the newly added Server instance.
  16. Click the Configuration tab.
  17. Find the ZooKeeper Server ID property.
  18. Change it value, so it is the highest ZooKeeper Service ID set in the cluster.
  19. Click the Status tab.
  20. Click Actions.
  21. Select Start this Server.
    The new ZooKeeper role is started.
  22. Restart the ZooKeeper server that has an outdated configuration and is a follower.
  23. Restart the leader ZooKeeper server that has an outdated configuration.
  24. Confirm that a leader is elected after the restart, and the whole ZooKeeper service is in green state.
  25. Restart any dependent services, such as HBase, HDFS, YARN or Hive, that are marked to have stale configuration.