How to cluster JBoss Enterprise BRMS ?

Solution Verified - Updated -

Environment

  • JBoss Enterprise Business Rules Management System Platform (BRMS)
    • 5.x

Issue

  • How to configure JBoss Enterprise BRMS to provide high availability and failover?

Resolution

  • Set up a JBoss Enterprise Application Platform cluster, refer to the JBoss Enterprise Application Platform 5 Clustering Guide which is located in the Administration and Configuration Guide.
  • Set up a load balancer, refer to the JBoss Enterprise Application Platform 5 HTTP Connectors Load Balancing Guide.
  • Deploy a copy of jboss-brms.war to each node of the application server cluster $JBOSS_HOME/server/nodeX/deploy/
  • The Default configuration uses embedded databases that are not suitable or supported for production environments. Before deploying into a production environment this configuration must be changed to a supported database.
  • Each node in the cluster must have an individual workspace, version, and search index configured in the repository.xml file. Generate the_ repository.xml_ for the required database by logging in to the JBoss Enterprise BRMS user interface and selecting Administration → Repository Configuration.
  • Copy the repository.xml file to the repository location specified in the jboss-brms.war/WEB-INF/components.xml in each node of the cluster.
  • Each node in the cluster must have a unique ID, which is set in each node's copy of the repository.xml file. For instance:
<Cluster id="01" syncDelay="2000">
   <Journal class="org.apache.jackrabbit.core.journal.DatabaseJournal">
      <param name="revision" value="${rep.home}/revision.log" />
      <param name="driver" value="javax.naming.InitialContext" />
    <param name="url" value="brms-jdbc-ds" />
    <param name="schema" value="mysql"/>
   </Journal>
</Cluster>
  • Each node in the cluster must have a different data store for "<FileSystem> under <Workspace>" and "<FileSystem> under <Versioning>". You can achieve it by setting node unique "schemaObjectPrefix". For instance:
  <Workspace name="${wsp.name}">

    <FileSystem class="org.apache.jackrabbit.core.fs.db.DbFileSystem">
      <param name="driver" value="javax.naming.InitialContext" />
      <param name="url" value="brms-jdbc-ds" />
      <param name="schema" value="mysql"/>
      <param name="schemaObjectPrefix" value="FS_WS_${wsp.name}_node1"/>
    </FileSystem>
...
  </Workspace>

  <Versioning rootPath="${rep.home}/version">

    <FileSystem class="org.apache.jackrabbit.core.fs.db.DbFileSystem">
      <param name="driver" value="javax.naming.InitialContext" />
      <param name="url" value="brms-jdbc-ds" />
      <param name="schema" value="mysql"/>
      <param name="schemaObjectPrefix" value="Versioning_FS_node1"/>
    </FileSystem>
...
  <?versioning>
  • All cluster nodes must point to the same data store location for "all <PersistenceManager>" and "<FileSystem> under <Repository>". The data store should be used to store large binaries (all cluster nodes need to access the same data store). Please refer to attached example repository.xml.
  • When not using the data store, one need to set the parameter externalBLOBs to false so that large binaries are stored in the persistence manager.
  • Add the element as a child element of the web-app element to the jboss-brms.war/WEB-INF/web.xml file.
  • Verify the Cluster Nodes are working by logging into the JBoss Enterprise BRMS user interface. Examine the terminal output to confirm which node is handling the session. Shut down that node, after a short interval another node in the cluster should take over the session.

Special note for Oracle database
Even when used the OracleDatabaseJournal, it is necessary set the parameter :

<param name="databaseType" value="oracle"/>

Otherwise the SQL is not compatible with Oracle and Jackrabbit fails to create the journal tables (and BRMS can't start anymore).

If you don't set the parameter there will be datatype problems like this :

2012-07-02 14:58:15,926 CONFIG [oracle.jdbc.driver] (main) SQL: create table JOURNAL (REVISION_ID BIGINT NOT NULL, JOURNAL_ID varchar(255), PRODUCER_ID varchar(255), REVISION_DATA varbinary)
2012-07-02 14:58:15,942 SEVERE [oracle.jdbc.driver] (main) Throwing SQLException: ORA-00902: type de données non valide

=> "bigint" is not known in Oracle

Note
This article explains how to cluster jboss-brms.war and its repository. If you want to cluster jBPM components in BRMS, please refer to BRMS Getting Started Guide.

If you want to cluster a web application which uses Drools runtime, you should follow an usual way of clustering web applications. In case that you need to replicate StatefulKnowledgeSession, please refer to the knowledge base article: Is it possible to cluster a StatefulKnowledgeSession?.

Attachments

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments