Configure ZooKeeper Ensemble for TIBCO OI Hawk RedTail

By configuring a ZooKeeper ensemble, the ZooKeeper service on all machines can communicate with each other for service discovery, leader election, and fallback mechanism.

Example: The machines that are to be part of the HA deployment have the following IP addresses:

192.0.2.1
192.0.2.2
192.0.2.3

To configure ZooKeeper ensemble, perform the following steps:

Before you begin
Install TIBCO OI Hawk RedTail on at least three separate machines.
Specify IP addresses as the value of configuration parameters instead of localhost for every TIBCO OI Hawk RedTail component. For more information, see Configuration of TIBCO OI Hawk RedTail Enterprise Components.
Stop all running TIBCO OI Hawk RedTail services. For more information, see Stopping and Restarting TIBCO OI Hawk RedTail Enterprise Components.
Note: Perform these steps on all the machines which are to be a part of High Availability deployment.
    Procedure
  1. Go to DATA_FOLDER/zookeeper.

  2. Create a file named myid and insert 1 as the value. The value within the file is treated as the machine ID. For example, to create a file named myid, and enter 1 as the id for the 192.0.2.1 machine, you can run the following commands:
    sudo echo 1 > myid
    sudo chown redtail:redtail myid
    Note: You must create the file with the name myid.
  3. Verify the value of the file and then save the file.
    Note: Each machine that is a part of HA deployment must have incremental IDs. For example, if the file present on the ZooKeeper data directory on 192.0.2.1 has its value as 1, then the value of the file present in the ZooKeeper data directory on 192.0.2.2 must be 2.
  4. Modify the zoo.cfg file in the CONFIG_FOLDER_REDTAIL and append the following configuration parameters:
    tickTime=2000
    initLimit=10
    syncLimit=5

    server.1=192.0.2.1:2788:3788
    server.2=192.0.2.2:2788:3788
    server.3=192.0.2.3:2788:3788
  5. Comment the clientPortAddress parameter in the zoo.cfg file. By commenting this, you enable ZooKeeper member on different machines to communicate with each other.
  6. Open the ports for communication within ZooKeeper servers for leader election and data synchronization and then restart the firewall. For example, if 2788 and 3788 are the ports that we want to use for communication, use the following command to open the ports for communication:
    sudo firewall-cmd --zone=public --add-port=2788/tcp --permanent

    sudo firewall-cmd --zone=public --add-port=3788/tcp --permanent

    sudo firewall-cmd --reload

    You can use the following command to verify whether the ports are actually open:

    sudo firewall-cmd --list-all

  7. Start the ZooKeeper service and verify the ZooKeeper logs.
  8. Configure the zookeeper.connectString parameter for every component in TIBCO OI Hawk RedTail.

    For TLS connection:
    "192.0.2.1:9600,192.0.2.2:9600,192.0.2.3:9600"

    For example, you must configure the value of zookeeper.connectString parameter in the rt_querynode_vars.json as follows:
    "zookeeper.connectString":"192.0.2.1:9600,192.0.2.2:9600,192.0.2.3:9600"

    For non-TLS connection:
    "192.0.2.1:9601,192.0.2.2:9601,192.0.2.3:9601"

    For example, you must configure the value of zookeeper.connectString parameter in the rt_webapp_vars.json as follows:
    "ZOOKEEPER_CONNECT_STRING":"192.0.2.1:9601,192.0.2.2:9601,192.0.2.3:9601"

    For more information, see Configuration of TIBCO OI Hawk RedTail Enterprise Components.