Configuring master host nodes as ZooKeeper node

Use this procedure to configure each master host node in a high-availability deployment as a node in a ZooKeeper ensemble. Perform this procedure on the primary node and on the secondary node.
  1. Log in to a master host node 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
    Use the virtual IP address or hostname of the high-availability cluster as the value for node1.
  3. Set the ZooKeeper node ID to 1.
    echo "SERVICED_ISVCS_ZOOKEEPER_ID=1" >> /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 the master host with 0.0.0.0.
    You can copy the following text and paste it in your console:
    q1="1@0.0.0.0:2888:3888"
    q2="2@${node2}:2888:3888"
    q3="3@${node3}: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. 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. Navigate to the end of the file, and cut the line that contains the SERVICED_ISVCS_ZOOKEEPER_ID variable declaration at that location.
    5. Locate the original SERVICED_ISVCS_ZOOKEEPER_ID variable declaration, and then paste the cut line immediately below it.
    6. Navigate to the end of the file, and cut the line that contains the SERVICED_ISVCS_ZOOKEEPER_QUORUM variable declaration at that location.
    7. Locate the original SERVICED_ISVCS_ZOOKEEPER_QUORUM variable declaration, and then paste the cut line immediately below it.
    8. Navigate to the end of the file, and cut the line that contains the SERVICED_ZK_SESSION_TIMEOUT variable declaration at that location.
    9. Locate the original SERVICED_ZK_SESSION_TIMEOUT variable declaration, and then paste the cut line immediately below it.
    10. Save the file, and then close the editor.
  8. Verify the ZooKeeper environment variables.
    grep -E '^\b*SERVICED' /etc/default/serviced | grep -E '_Z(OO|K)'
    The following example shows the environment variables for a master host with IP address 198.51.100.135.
    SERVICED_ZK=198.51.100.135:2181,198.51.100.136:2181,198.51.100.137:2181
    SERVICED_ISVCS_ZOOKEEPER_ID=1
    SERVICED_ISVCS_ZOOKEEPER_QUORUM=1@0.0.0.0:2888:3888,\
      2@198.51.100.136:2888:3888,3@198.51.100.137:2888:3888
    SERVICED_ZK_SESSION_TIMEOUT=15
Repeat this procedure on the other master host node.