Configuring the master host as a ZooKeeper node

This procedure configures the Control Center master host as a node in a ZooKeeper ensemble.

  1. Log in to the master 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 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. 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