5.2. Generic Bundle Clustering
5.2.1. Setting up a Cluster
- Download the
jboss-bpmsuite-brms-VERSION-supplementary-tools.zip, which contains Apache Zookeeper, Apache Helix, and Quartz DDL scripts. After downloading, unzip the archive: theZookeeperdirectory ($ZOOKEEPER_HOME) and theHelixdirectory ($HELIX_HOME) are created. - Now Configure ZooKeeper:
- In the ZooKeeper directory, go to
confdirectory and do the following:cp zoo_sample.cfg zoo.cfg
- Open
zoo.cfgfor editing and adjust the settings including the following:# the directory where the snapshot is stored. dataDir=$ZOOKEEPER_HOME/data/ # the port at which the clients connects clientPort=2181 server.1=server1:2888:3888 server.2=server2:2888:3888 server.3=server3:2888:3888
Make sure the dataDir location exists and is accessible. - Assign a node ID to each member that will run ZooKeeper. For example, use "1", "2" and "3" respectively for node 1, node 2 and node 3 respectively. ZooKeeper should have an odd number of instances, at least 3 in order to recover from failure.The node ID is specified in a field called
myidunder the data directory of ZooKeeper on each node. For example, on node 1, run:$ echo "1" > /zookeeper/data/myid
- Set up ZooKeeper, so you can use it when creating the cluster with Helix:
- Go to the
$ZOOKEEPER_HOME/bin/directory and start ZooKeeper:./zkServer.sh start
You can check the ZooKeeper log in the$ZOOKEEPER_HOME/bin/zookeeper.outfile. Check this log to ensure that the 'ensemble' (cluster) is formed successfully. One of the nodes should be elected as leader with the other two nodes following it.
- Once the ZooKeeper ensemble is started, the next step is to configure and start Helix. Helix only needs to be configured once and from a single node. The configuration is then stored by the ZooKeeper ensemble and shared as appropriate.Set up the cluster with the ZooKeeper server as the master of the configuration:
- Create the cluster by providing the ZooKeeper Host and port as a comma separated list:
$HELIX_HOME/bin/helix-admin.sh --zkSvr ZOOKEEPER_HOST:ZOOKEEPER_PORT --addCluster CLUSTER_NAME
- Add your nodes to the cluster:
$HELIX_HOME/bin/helix-admin.sh --zkSvr ZOOKEEPER_HOST:ZOOKEEPER_PORT --addNode CLUSTER_NAME NODE_NAMEUNIQUE_ID
Example 5.4. Adding two cluster nodes
./helix-admin.sh --zkSvr server1:2181,server2:2181,server3:2181 --addNode brms-cluster nodeOne:12345 ./helix-admin.sh --zkSvr server1:2181,server2:2181,server3:2181 --addNode brms-cluster nodeTwo:12346 ./helix-admin.sh --zkSvr server1:2181,server2:2181,server3:2181 --addNode brms-cluster nodeThree:12347
- Add resources to the cluster.
Example 5.5. Adding vfs-repo as resource
./helix-admin.sh --zkSvr server1:2181,server2:2181,server3:2181 --addResource brms-cluster vfs-repo 1 LeaderStandby AUTO_REBALANCE
- Rebalance the cluster with the three nodes.
Example 5.6. Rebalancing the brms-cluster
./helix-admin.sh --zkSvr server1:2181,server2:2181,server3:2181 --rebalance brms-cluster vfs-repo 3
In the above command,3stands for three zookeeper nodes. - Start the Helix controller in all the nodes in the cluster.
Example 5.7. Starting the Helix controller
./run-helix-controller.sh --zkSvr server1:2181,server2:2181,server3:2181 --cluster brms-cluster 2>&1 > /tmp/controller.log &
Note
Stopping Helix and Zookeeper
Procedure 5.1. Stopping Helix and Zookeeper
- Stop JBoss EAP server processes.
- Stop the Helix process that has been created by
run-helix-controller.sh, for example,kill -15 <pid of HelixControllerMain>. - Stop ZooKeeper server using the
zkServer.sh stopcommand.

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.