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:
| • | 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. |
- Procedure
-
Go to DATA_FOLDER/zookeeper.
- Create a file named
myidand insert 1 as the value. The value within the file is treated as the machine ID. For example, to create a file namedmyid, 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 myidNote: You must create the file with the namemyid. - 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.
- Modify the
zoo.cfgfile 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 - Comment the
clientPortAddressparameter in thezoo.cfgfile. By commenting this, you enable ZooKeeper member on different machines to communicate with each other. - Open the ports for communication within ZooKeeper servers for leader election and data synchronization and then restart the firewall. For example, if
2788and3788are 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 --reloadYou can use the following command to verify whether the ports are actually open:
sudo firewall-cmd --list-all
- Start the ZooKeeper service and verify the ZooKeeper logs.
- Configure the
zookeeper.connectStringparameter 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.connectStringparameter in thert_querynode_vars.jsonas 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.connectStringparameter in thert_webapp_vars.jsonas 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.