Chapter 6. Clustering
- 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
Figure 6.1. Schema of Red Hat JBoss BPM Suite system with individual system components
GIT Repository Clustering Mechanism
- Apache Zookeeper brings all parts together.
- Apache Helix is the cluster management component that registers all cluster details (the cluster itself, nodes, resources).
- uberfire framework which provides the backbone of the web applications
Figure 6.2. Clustering schema with Helix and Zookeeper
- 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
rsync.
6.1. Clustering on JBoss EAP Copy linkLink copied to clipboard!
6.1.1. Clustering using JAR Installer Copy linkLink copied to clipboard!
Note
business-central.war, dashbuilder.war, and kie-server.war deployed. To customize the setup to fit your scenario, or to use clustering with the deployable ZIP, see the Section 6.1.2, “Custom Configuration (Deployable ZIP)”. You can also get more information in the JBoss EAP documentation.
Note
Select JDBC provider
On this screen, select the JDBC provider from the list. You need to provide the corresponding JDBC driver JAR(s) in one of these ways:- Select one or more files on the filesystem
- Provide one or more URLs. The installer downloads the files automatically.
The installer then copies the JAR(s) into the appropriate location under the directory$EAP_HOME/modules, where a correspondingmodule.xmlfile is also created automatically.
Figure 6.3. JDBC Driver setup
Configure Quartz connection
On the next screen, provide the data to the database for Quartz. The installer automatically creates the Quartz definition file ($EAP_HOME/domain/configuration/quartz-definition.properties) and two Quartz datasources in the domain configuration file$EAP_HOME/domain/domain.xml. You may edit the files after having finished the installation.Note
During the installation, Quartz DDL scripts will be run on the database selected in this step. These scripts make changes needed for Quartz to operate (adding tables, etc.), and can be found in$EAP_HOME/jboss-brms-bpmsuite-6.2-supplementary-tools/ddl-scriptsfor reference (You do not need to modify them in any way).
Figure 6.4. Quartz database setup
- Click next to initiate the installation.
Important
When using the JAR installer, thewararchives are automatically created from the applications residing in$EAP_HOME/standalone/deployments/. That means additional space is necessary as the applications exist both in uncompressed and compressed state in the storage during the installation.Three ZooKeeper instances are automatically created in$EAP_HOME/jboss-brms-bpmsuite-6.2-supplementary-tools/(directory nameszookeeper-one,zookeeper-two, andzookeeper-three).In the directory$EAP_HOME/jboss-brms-bpmsuite-6.2-supplementary-tools/helix-core, you can find the default Helix configuration and the scripts to launch the cluster—startCluster.shfor UNIX andstartCluster.batfor Windows.After the installation finishes, DO NOT select to run the server immediately. You first need to start the cluster by moving to the directory$EAP_HOME/jboss-brms-bpmsuite-6.2-supplementary-tools/helix-coreand executing the aforementioned launch script:On UNIX systems:./startCluster.shOn Windows:./startCluster.batThis script launches the Helix cluster and the ZooKeeper instances. Only after that, start the EAP server in domain mode by moving to the directory$EAP_HOME/binand running:On UNIX systems:./domain.shOn Windows:./domain.bat
6.1.2. Custom Configuration (Deployable ZIP) Copy linkLink copied to clipboard!
- Configure ZooKeeper and Helix according to Section 6.2.1, “Setting up a Cluster”.
- Configure Quartz according to Section 6.2.2, “Setting up Quartz”.
- Install your JDBC driver as a core module: copy the driver jar to
$EAP_HOME/modules/system/layers/base/and create amodule.xmlfile in the directory. - Edit the
module.xmlfile as of the respective module XSD.Example 6.1. 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> - Configure the data source for the server: open for editing the
host.xmlorstandalone.xmlfile, depending on the used PROFILE located in$EAP_HOME/PROFILE/, locate thefullprofile, and do the following:- Add the definition of the main datasource used by JBoss BPM Suite.
Example 6.2. The PostgreSQL datasource defined as the main JBoss BPM Suite datasource
<datasource jndi-name="java:jboss/datasources/psbpmsDS" pool-name="postgresDS" enabled="true" use-java-context="true"> <connection-url>jdbc:postgresql://localhost:5432/jbpm</connection-url> <driver>postgres</driver> <security> <user-name>bpms</user-name> <password>bpms</password> </security> </datasource> - Add the definition of the data source for the Quartz service.
Example 6.3. The PostgreSQL datasource defined as the Quartz datasource
<datasource jta="false" jndi-name="java:jboss/datasources/quartzNotManagedDS" pool-name="quartzNotManagedDS" enabled="true" use-java-context="true"> <connection-url>jdbc:postgresql://localhost:5432/jbpm</connection-url> <driver>postgres</driver> <security> <user-name>bpms</user-name> <password>bpms</password> </security> </datasource> - Define the data source driver.
Example 6.4. The PostgreSQL driver definition
<driver name="postgres" module="org.postgresql"> <xa-datasource-class>org.postgresql.xa.PGXADataSource</xa-datasource-class> </driver>
- Configure individual server nodes in the
main-server-groupelement in the$EAP_HOME/domain/configuration/host.xmlfile 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.Expand Table 6.1. Cluster node properties Property name Value Description jboss.node.namenodeOnenode name unique within the clusterorg.quartz.properties/bpms/quartz-definition.propertiesabsolute path to the Quartz configuration fileorg.uberfire.cluster.idbpms-clusterHelix cluster nameorg.uberfire.cluster.local.idnodeOne_12345unique ID of the Helix cluster nodeNote that:is replaced with_.org.uberfire.cluster.vfs.lockvfs-reponame of the resource defined on the Helix clusterorg.uberfire.cluster.zkserver1:2181Zookeeper locationorg.uberfire.metadata.index.dir/home/jbpm/node[N]/indexlocation where the index for search is to be created (maintained by Apache Lucene)org.uberfire.nio.git.daemon.hostnodeOnethe name of the daemon host machine in a physical cluster. org.uberfire.nio.git.daemon.port9418port used by the VFS repo to accept client connectionsThe port must be unique for each cluster member.org.uberfire.nio.git.dir/home/jbpm/node[N]/repoGIT (VFS) repository location on node[N]org.uberfire.nio.git.ssh.hostnodeOnethe name of the SSH host machine in a physical cluster. org.uberfire.nio.git.ssh.port8003the 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.hostport8003 and 9418In a virtualized environment, the outside port to be used. Example 6.5. 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.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.6. 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.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.7. 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.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> - 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.
- Move to the directory
$EAP_HOME/binand start the application server in domain mode:On UNIX systems:./domain.shOn Windows:./domain.bat - Check that the nodes are available.
- Change the predefined persistence of the application to the required data base (PostgreSQL): in
persistence.xmlchange the following:- jta-data-source name to the source defined on the application server (
java:jboss/datasources/psbpmsDS) - hibernate dialect to be match the data source dialect (
org.hibernate.dialect.PostgreSQLDialect)
- 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
deployed. Any request targeting this deployment unit sent to a different cluster member fails with DeploymentNotFoundException.