Adding a ZooKeeper Role

Describes how to add a ZooKeeper role to a Data Fabric node by using the CLI.

About this task

If you are increasing the number of ZooKeeper roles in the cluster, for example from one to three, shut down the cluster before you add the role to the nodes to prevent any problems. Then restart the cluster upon completion. Complete the following steps to add the ZooKeeper role to a node:

Procedure

  1. Install the ZooKeeper package corresponding to the new role. For more information about packages, see Data Fabric Repositories and Packages.
  2. To identify the ZooKeeper nodes in the cluster, run maprcli node listzookeepers.
  3. Copy the tokens and all other directories needed from the existing nodes. You can find the list of files you need to copy in Enabling Security.
    IMPORTANT Copying files as root user results in the files being unreadable. Make sure the copied files are readable as the cluster admin user.
  4. On all nodes in the cluster where you added the new ZooKeeper role, run configure.sh with the following options:
    • -Z: This option specifies the list of ZooKeeper nodes.
    • -R: This option uses all previously set configurations.
    For example:
    /opt/mapr/server/configure.sh -Z <all-nodes-including-new-one> -R
  5. Restart the servies on all nodes:
    1. Run the following command on all nodes to start or restart ZooKeeper:
      systemctl restart mapr-zookeeper
    2. Perform a rolling restart of ZooKeeper on all nodes. A rolling restart of ZooKeeper means restart ZooKeeper on each node, one at a time, pausing until the last restart finishes before beginning the next. Restart the ZooKeeper leader last.
    3. Run the following command to verify that the new node joined the ZooKeeper quorum:
      /opt/mapr/initscripts/zookeeper qstatus
    4. Perform a rolling restart of Warden on all nodes. Warden picks up the new ZooKeeper node. Issue the following command on all nodes to restart Warden:
      systemctl restart mapr-warden
  6. Run maprcli node listzookeepers. The output should show all ZooKeeper nodes, including the node where the role was added.