Configuring delegate host B as a ZooKeeper node

Use this procedure to configure the delegate host designated as Delegate-B as a ZooKeeper node.
  1. Log in to the delegate host as root, or as a user with superuser privileges.
  2. Define the IP address variables for each node in the ZooKeeper ensemble.
    Replace Master with the IP address or hostname of the Control Center master host, and replace Delegate-A and Delegate-B with the IP addresses or hostnames of the delegate hosts to include in the ensemble:
    node1=Master
    node2=Delegate-A
    node3=Delegate-B
  3. Set the ID of this node in the ZooKeeper ensemble.
    echo "SERVICED_ISVCS_ZOOKEEPER_ID=3" >> /etc/default/serviced
  4. Specify the nodes in the ZooKeeper ensemble.
    You can copy the following text and paste it in your console:
    echo "SERVICED_ZK=${node1}:2181,${node2}:2181,${node3}:2181" \
      >> /etc/default/serviced
  5. Specify the nodes in the ZooKeeper quorum.
    ZooKeeper requires a unique quorum definition for each node in its ensemble. To achieve this, replace the IP address or hostname of delegate host B with 0.0.0.0.
    You can copy the following text and paste it in your console:
    q1="1@${node1}:2888:3888"
    q2="2@${node2}:2888:3888"
    q3="3@0.0.0.0:2888:3888"
    echo "SERVICED_ISVCS_ZOOKEEPER_QUORUM=${q1},${q2},${q3}" \
      >> /etc/default/serviced
  6. Specify the timeout for inactive connections.
    You can copy the following text and paste it in your console:
    echo "SERVICED_ZK_SESSION_TIMEOUT=15" >> /etc/default/serviced
  7. Configure Control Center to start the ZooKeeper service.
    You can copy the following text and paste it in your console:
    echo "SERVICED_ISVCS_START=zookeeper" >> /etc/default/serviced
  8. Clean up the Control Center configuration file.
    1. Open /etc/default/serviced in a text editor.
    2. Navigate to the end of the file, and cut the line that contains the SERVICED_ZK variable declaration at that location.
    3. Locate the original SERVICED_ZK variable declaration, and then paste the cut line immediately below it.
    4. Comment the original SERVICED_ZK declaration, which references only the master host.
      Insert the number sign character (#) immediately in front of the original SERVICED_ZK variable.
    5. Navigate to the end of the file, and cut the line that contains the SERVICED_ISVCS_ZOOKEEPER_ID variable declaration at that location.
    6. Locate the original SERVICED_ISVCS_ZOOKEEPER_ID variable declaration, and then paste the cut line immediately below it.
    7. Navigate to the end of the file, and cut the line that contains the SERVICED_ISVCS_ZOOKEEPER_QUORUM variable declaration at that location.
    8. Locate the original SERVICED_ISVCS_ZOOKEEPER_QUORUM variable declaration, and then paste the cut line immediately below it.
    9. Navigate to the end of the file, and cut the line that contains the SERVICED_ZK_SESSION_TIMEOUT variable declaration at that location.
    10. Locate the original SERVICED_ZK_SESSION_TIMEOUT variable declaration, and then paste the cut line immediately below it.
    11. Navigate to the end of the file, and cut the line that contains the SERVICED_ISVCS_START variable declaration at that location.
    12. Locate the original SERVICED_ISVCS_START variable declaration, and then paste the cut line immediately below it.
    13. Save the file, and then close the editor.
  9. Verify the ZooKeeper environment variables.
    grep -E '^\b*SERVICED' /etc/default/serviced \
      | grep -E '(CS_ZO|_ZK|CS_ST)'
    The following example shows the environment variables for a delegate host with IP address 198.51.100.137.
    SERVICED_ZK=198.51.100.135:2181,198.51.100.136:2181,198.51.100.137:2181
    SERVICED_ISVCS_START=zookeeper
    SERVICED_ISVCS_ZOOKEEPER_ID=3
    SERVICED_ISVCS_ZOOKEEPER_QUORUM=1@198.51.100.135:2888:3888,\
      2@198.51.100.136:2888:3888,3@0.0.0.0:2888:3888
    SERVICED_ZK_SESSION_TIMEOUT=15