Chapter 6. Clustering

When clustering Red Hat JBoss BPM Suite, consider which components need to be clustered. You can cluster the following:
  • GIT repository: virtual-file-system (VFS) repository that holds the business assets so that all cluster nodes use the same repository
  • Execution Server and Web applications: the runtime server that resides in the container (such as, Red Hat JBoss EAP) along with BRMS and BPM Suite web applications so that nodes share the same runtime data.
    For instructions on clustering the application, refer to the container clustering documentation.
  • Back-end database: database with the state data, such as, process instances, KIE sessions, history log, etc., for fail-over purposes
Schema of BPMS system with individual system components

Figure 6.1. Schema of BPMS system with individual system components

GIT repository clustering mechanism

To cluster the GIT repository the following is used:
  • Apache Zookeeper brings all parts together.
  • Apache Helix is the cluster management component that registers all cluster details (the cluster itself, nodes, resources).
The runtime environment, that is the Execution Server, utilizes the following to provide the clustering capabilities:
  • kie-commons provides VFS implementation and clustering
  • uber fire framework provides backbone of the web applications
Clustering schema with Helix and Zookeeper

Figure 6.2. Clustering schema with Helix and Zookeeper

A typical clustering setup involves the following:
  • Setting up the cluster itself using Zookeeper and Helix
  • Setting up the back-end database with Quartz tables and configuration
  • Configuring clustering on your container (this documentation provides only clustering instructions for Red Hat JBoss EAP 6)

Clustering Maven Repositories

Various operations within the Business Central publish JARs to the Business Central's internal Maven Repository.
This repository exists on the application server's file-system as regular files and is not cluster aware. This folder is not synchronized across the various nodes in the cluster and must be synchronized using external tools like rsync.
An alternate to the use of an external synchronization tool is to set the system property org.guvnor.m2repo.dir on each cluster node to point to a SAN or NAS. In this case clustering of the Maven repository folder is not needed.

6.1. Setting up a cluster

To cluster your GIT (VFS) repository in Business Central, do the following (If you don't use Business Central, you may skip this section):
  1. Download the jboss-bpms-brms-VERSION-redhat-supplementary-tools.zip, which contains Apache Zookeeper, Apache Helix, and quartz DDL scripts. After downloading, unzip the archive: the Zookeeper directory ($ZOOKEEPER_HOME) and the Helix directory ($HELIX_HOME) are created.
  2. Now Configure Zookeeper:
    1. In the Zookeeper directory, go to conf directory and do the following:
      cp zoo_sample.cfg zoo.cfg
    2. Open zoo.cfg for editing and adjust the settings including the following:
      # the directory where the snapshot is stored.
      dataDir=$ZOOKEEPER_HOME/tmp/
      # the port at which the clients connects
      clientPort=2181
      Make sure the dataDir location exists and is accessible.
  3. Set up Zookeeper, so you can use it when creating the cluster with Helix:
    1. 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.out file.
  4. Set up the cluster with the Zookeeper server as the master of the configuration:
    1. Create the cluster:
      $HELIX_HOME/bin/helix-admin.sh --zkSvr ZOOKEEPER_HOST:ZOOKEEPER_PORT --addCluster CLUSTER_NAME
    2. Add your nodes to the cluster:
      $HELIX_HOME/bin/helix-admin.sh --zkSvr ZOOKEEPER_HOST:ZOOKEEPER_PORT --addNode CLUSTER_NAME NODE_NAMEUNIQUE_ID

      Example 6.1. Adding two cluster nodes

      ./helix-admin.sh --zkSvr localhost:2181 --addNode bpms-cluster nodeOne:12345
      ./helix-admin.sh --zkSvr localhost:2181 --addNode bpms-cluster nodeTwo:12346
  5. Add resources to the cluster.

    Example 6.2. Adding vfs-repo as resource

    ./helix-admin.sh --zkSvr localhost:2181 --addResource bpms-cluster vfs-repo 1 LeaderStandby AUTO_REBALANCE
  6. Rebalance the cluster.

    Example 6.3. Rebalancing the bpms-cluster

    ./helix-admin.sh --zkSvr localhost:2181 --rebalance bpms-cluster vfs-repo 2
    
  7. Start the Helix controller.

    Example 6.4. Starting the Helix controller

    ./run-helix-controller.sh --zkSvr localhost:2181 --cluster bpms-cluster 2>&1 > /tmp/controller.log &