Configuring delegate host A as a ZooKeeper node

Use this procedure to configure the delegate host designated as Delegate-A 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=2" >> /etc/default/serviced
  4. Remove the existing definition of the SERVICED_ZK variable, which specifies only the Control Center master host.
    sed -i.bak '/SERVICED_ZK=/d' /etc/default/serviced
  5. 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
  6. 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 A with 0.0.0.0.
    You can copy the following text and paste it in your console:
    q1="1@${node1}:2888:3888"
    q2="2@0.0.0.0:2888:3888"
    q3="3@${node3}:2888:3888"
    echo "SERVICED_ISVCS_ZOOKEEPER_QUORUM=${q1},${q2},${q3}" \
      >> /etc/default/serviced
  7. 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
  8. 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
  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.136.
    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=2
    SERVICED_ISVCS_ZOOKEEPER_QUORUM=1@198.51.100.135:2888:3888,\
      2@0.0.0.0:2888:3888,3@198.51.100.137:2888:3888
    SERVICED_ZK_SESSION_TIMEOUT=15