6.3. Configuring Clustering on Red Hat JBoss EAP

The information provided in this section is a simple clustering recipe. For additional information on clustering refer to Red Hat JBoss EAP documentation.
When using JBoss EAP clustering, a single JBoss EAP domain controller exists with other JBoss EAP slaves connecting to it as management users. Deployment of Business Central and dashbuilder can be done as a management user on a domain controller, and the WAR deployments will be distributed to other members of the JBoss EAP cluster.
To configure clustering on Red Hat JBoss EAP 6, do the following:
  1. Install your JDBC driver as a core module: copy the driver jar to $EAP_HOME/modules/system/layers/base/ and create a module.xml file in the directory.
  2. Edit the module.xml file as of the respective module XSD.

    Example 6.6. The module.xml file content for a PostgreSQL datasource

    <module xmlns="urn:jboss:module:1.0" name="org.postgresql">
      <resources>
        <resource-root path="postgresql-jdbc.jar"/>
      </resources>
    
      <dependencies>
        <module name="javax.api"/>
        <module name="javax.transaction.api"/>
      </dependencies>
    </module>
    
  3. Configure individual server nodes in the main-server-group element in the $EAP_HOME/domain/configuration/host.xml file with properties defined in Table 6.1, “Cluster node properties”:
    Note that a when configuring a JBoss EAP cluster with Zookeeper, a different number of JBoss EAP nodes than Zookeeper nodes is possible (keeping in mind that Zookeeper should to have an odd number of nodes). However, having the same node count for both Zookeeper and JBoss EAP is considered best practice.

    Table 6.1. Cluster node properties

    Property name Value Description
    jboss.node.name nodeOne
    node name unique within the cluster
    org.quartz.properties /bpms/quartz-definition.properties
    absolute path to the quartz configuration file
    org.uberfire.cluster.autostart true
    This value delays VFS clustering until the application is fully initialized to avoid conficts when all cluster members create local clones.
    org.uberfire.cluster.id bpms-cluster
    Helix cluster name
    org.uberfire.cluster.local.id nodeOne_12345
    unique ID of the Helix cluster node
    Note that : is replaced with _.
    org.uberfire.cluster.vfs.lock vfs-repo
    name of the resource defined on the Helix cluster
    org.uberfire.cluster.zk server1:2181
    Zookeeper location
    org.uberfire.metadata.index.dir /home/jbpm/node[N]/index
    location where the index for search is to be created (maintained by Apache Lucene)
    org.uberfire.nio.git.daemon.host nodeOne the name of the daemon host machine in a physical cluster.
    org.uberfire.nio.git.daemon.port 9418
    port used by the VFS repo to accept client connections
    The port must be unique for each cluster member.
    org.uberfire.nio.git.dir /home/jbpm/node[N]/repo
    GIT (VFS) repository location on node[N]
    org.uberfire.nio.git.ssh.host nodeOne the name of the SSH host machine in a physical cluster.
    org.uberfire.nio.git.ssh.port 8003 the unique port number for ssh access to the GIT repo for a cluster running on physical machines.
    org.uberfire.nio.git.ssh.hostport and org.uberfire.nio.git.daemon.hostport 8003 and 9418 In a virtualized environment, the outside port to be used.

    Example 6.7. Cluster nodeOne configuration

    <system-properties>
    				
      <property name="org.uberfire.nio.git.dir" value="/tmp/bpms/nodeone" boot-time="false"/>
      <property name="jboss.node.name" value="nodeOne" boot-time="false"/>
      
      <property name="org.uberfire.cluster.id" value="bpms-cluster" boot-time="false"/>
      <property name="org.uberfire.cluster.zk" value="server1:2181,server2:2181,server3:2181" boot-time="false"/>
      <property name="org.uberfire.cluster.local.id" value="nodeOne_12345" boot-time="false"/>
      <property name="org.uberfire.cluster.vfs.lock" value="vfs-repo" boot-time="false"/>
      <property name="org.uberfire.cluster.autostart" value="true" boot-time="true"/>
      
      <property name="org.uberfire.nio.git.daemon.host" value="nodeOne" />
      <property name="org.uberfire.nio.git.daemon.port" value="9418" boot-time="false"/>
      <property name="org.uberfire.nio.git.daemon.hostport" value="9418" boot-time="false"/>
      
      <property name="org.uberfire.nio.git.ssh.port" value="8003" boot-time="false"/>
      <property name="org.uberfire.nio.git.ssh.hostport" value="8003" boot-time="false"/>
      <property name="org.uberfire.nio.git.ssh.host" value="nodeOne" />
      
      <property name="org.uberfire.metadata.index.dir" value="/tmp/jbpm/nodeone" boot-time="false"/>
      <property name="org.uberfire.nio.git.ssh.cert.dir" value="/tmp/jbpm/nodeone" boot-time="false"/>
      
      <property name="org.quartz.properties" value="/tmp/jbpm/quartz/quartz-db-postgres.properties" boot-time="false"/>
      
    </system-properties>

    Example 6.8. Cluster nodeTwo configuration

    <system-properties>
    				
      <property name="org.uberfire.nio.git.dir" value="/tmp/bpms/nodetwo" boot-time="false"/>
      <property name="jboss.node.name" value="nodeTwo" boot-time="false"/>
      
      <property name="org.uberfire.cluster.id" value="bpms-cluster" boot-time="false"/>
      <property name="org.uberfire.cluster.zk" value="server1:2181,server2:2181,server3:2181" boot-time="false"/>
      <property name="org.uberfire.cluster.local.id" value="nodeTwo_12346" boot-time="false"/>
      <property name="org.uberfire.cluster.vfs.lock" value="vfs-repo" boot-time="false"/>
      <property name="org.uberfire.cluster.autostart" value="true" boot-time="true"/>
      
      <property name="org.uberfire.nio.git.daemon.host" value="nodeTwo" />
      <property name="org.uberfire.nio.git.daemon.port" value="9418" boot-time="false"/>
      <property name="org.uberfire.nio.git.daemon.hostport" value="9418" boot-time="false"/>
      
      <property name="org.uberfire.nio.git.ssh.port" value="8003" boot-time="false"/>
      <property name="org.uberfire.nio.git.ssh.hostport" value="8003" boot-time="false"/>
      <property name="org.uberfire.nio.git.ssh.host" value="nodeTwo" />
      
      <property name="org.uberfire.metadata.index.dir" value="/tmp/jbpm/nodetwo" boot-time="false"/>
      <property name="org.uberfire.nio.git.ssh.cert.dir" value="/tmp/jbpm/nodetwo" boot-time="false"/>
      
      <property name="org.quartz.properties" value="/tmp/jbpm/quartz/quartz-db-postgres.properties" boot-time="false"/>				
    
    
    </system-properties>

    Example 6.9. Cluster nodeThree configuration

    <system-properties>
    				
      <property name="org.uberfire.nio.git.dir" value="/tmp/bpms/nodethree" boot-time="false"/>
      <property name="jboss.node.name" value="nodeThree" boot-time="false"/>
      
      <property name="org.uberfire.cluster.id" value="bpms-cluster" boot-time="false"/>
      <property name="org.uberfire.cluster.zk" value="server1:2181,server2:2181,server3:2181" boot-time="false"/>
      <property name="org.uberfire.cluster.local.id" value="nodeThree_12347" boot-time="false"/>
      <property name="org.uberfire.cluster.vfs.lock" value="vfs-repo" boot-time="false"/>
      <property name="org.uberfire.cluster.autostart" value="true" boot-time="true"/>
      
      <property name="org.uberfire.nio.git.daemon.host" value="nodeThree" />
      <property name="org.uberfire.nio.git.daemon.port" value="9418" boot-time="false"/>
      <property name="org.uberfire.nio.git.daemon.hostport" value="9418" boot-time="false"/>
      
      <property name="org.uberfire.nio.git.ssh.port" value="8003" boot-time="false"/>
      <property name="org.uberfire.nio.git.ssh.hostport" value="8003" boot-time="false"/>
      <property name="org.uberfire.nio.git.ssh.host" value="nodeThree" />
      
      <property name="org.uberfire.metadata.index.dir" value="/tmp/jbpm/nodethree" boot-time="false"/>
      <property name="org.uberfire.nio.git.ssh.cert.dir" value="/tmp/jbpm/nodethree" boot-time="false"/>
      
      <property name="org.quartz.properties" value="/tmp/jbpm/quartz/quartz-db-postgres.properties" boot-time="false"/>				
    
    
    </system-properties>
  4. Add management users as instructed in the Administration and Configuration Guide for Red Hat JBoss EAP and application users as instructed in Red Hat JBoss BPM Suite Administration and Configuration Guide.
  5. Start the application server:
    ]$ $JBOSS_HOME/bin/domain.sh
  6. Check that the nodes are available.
Deploy the Business Central application to your servers:
  1. Change the predefined persistence of the application to the required data base (PostgreSQL): in persistence.xml change the following:
    1. jta-data-source name to the source defined on the application server (java:jboss/datasources/psbpmsDS)
    2. hibernate dialect to be match the data source dialect (org.hibernate.dialect.PostgreSQLDialect)
  2. Log on as the management user to the server Administration console of your domain and add the new deployments using the Runtime view of the console. Once the deployment is added to the domain, assign it to the correct server group (main-server-group).

Note

It is important users explicitly check deployment unit readiness with every cluster member.
When a deployment unit is created on a cluster node, it takes some time before it is distributed among all cluster members. Deployment status can be checked via UI and REST, however if the query goes to the node where the deployment was originally issued, the answer is deployed. Any request targeting this deployment unit sent to a different cluster member fails with DeploymentNotFoundException.