-
Enhancement
-
Resolution: Done
-
Major
-
None
-
None
Cluster support for jbpm engine and kie server
It has two parts.
- jbpm CluterAwarenessService
- infinispan kie server cluster awareness service implementation
It is used for Jobs failover. When a node is killed or left automatically all jobs in that instance are requeued to another node.
In case there is timer start node in a process it only works in one of the nodes
Cluster are per kie server id
Steps to use it
Prerrequisites
check the subsystems in the standalone.xml are installed
<extension module="org.jboss.as.clustering.infinispan"/> <extension module="org.jboss.as.clustering.jgroups"/>
under the subsystem
<subsystem xmlns="urn:jboss:domain:infinispan:9.0">
you need to create the next container and cache (you can setup in any way you want but the container must be named jbpm and 2 caches need to be created (nodes and jobs)
<cache-container name="jbpm"> <transport lock-timeout="60000"/> <replicated-cache name="nodes"> <transaction mode="BATCH"/> </replicated-cache> <replicated-cache name="jobs"> <transaction mode="BATCH"/> </replicated-cache> </cache-container>
example of jgroups subsystem for replicate and distribute cache
<subsystem xmlns="urn:jboss:domain:jgroups:7.0"> <channels default="ee"> <channel name="ee" stack="udp" cluster="ejb"/> </channels> <stacks> <stack name="udp"> <transport type="UDP" socket-binding="jgroups-udp"/> <protocol type="PING"/> <protocol type="MERGE3"/> <socket-protocol type="FD_SOCK" socket-binding="jgroups-udp-fd"/> <protocol type="FD_ALL"/> <protocol type="VERIFY_SUSPECT"/> <protocol type="pbcast.NAKACK2"/> <protocol type="UNICAST3"/> <protocol type="pbcast.STABLE"/> <protocol type="pbcast.GMS"/> <protocol type="UFC"/> <protocol type="MFC"/> <protocol type="FRAG3"/> </stack> <stack name="tcp"> <transport type="TCP" socket-binding="jgroups-tcp"/> <socket-protocol type="MPING" socket-binding="jgroups-mping"/> <protocol type="MERGE3"/> <socket-protocol type="FD_SOCK" socket-binding="jgroups-tcp-fd"/> <protocol type="FD_ALL"/> <protocol type="VERIFY_SUSPECT"/> <protocol type="pbcast.NAKACK2"/> <protocol type="UNICAST3"/> <protocol type="pbcast.STABLE"/> <protocol type="pbcast.GMS"/> <protocol type="MFC"/> <protocol type="FRAG3"/> </stack> </stacks> </subsystem>
interfaces need to be configured as well
<interface name="private"> <inet-address value="${jboss.bind.address.private:127.0.0.1}"/> </interface>
and sockets in
<socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:0}">
<socket-binding name="jgroups-mping" interface="private" multicast-address="${jboss.default.multicast.address:230.0.0.4}" multicast-port="45700"/> <socket-binding name="jgroups-tcp" interface="private" port="7600"/> <socket-binding name="jgroups-tcp-fd" interface="private" port="57600"/> <socket-binding name="jgroups-udp" interface="private" port="55200" multicast-address="${jboss.default.multicast.address:230.0.0.4}" multicast-port="45688"/> <socket-binding name="jgroups-udp-fd" interface="private" port="54200"/>
install extension
Add to the jboss-deployment-structure.xml in kie-server.war/WEB-INF/jboss-deployment-structure.xml the below dependecies:
<module name="org.infinispan" services="export"/> <module name="org.jgroups" />
once all is check you need to copy the jar kie-server-services-jbpm-cluster.jar in kie-server.war/WEB-INF/lib
and automatically you will be able to use failover in jobs.
testing
Job failover
- setup 2 or more kie server instances
- create a job org.kie.server.services.jbpm.cluster.ReoccurringLongPrintOutCommand
- while the job is being executed kill the instance is executing it.
it should inmediatelly executed in the other node.
Start process once in clustered nodes.
- create a project with a start timer
- deploy
- only one process in the entire cluster will start.
- causes
-
JBPM-9540 Make kie-server-services-jbpm-cluster module compatible with JDK 11
- Resolved
- is related to
-
JBPM-9696 ClusteredRuntimeManagerLockFactory based on infinispan
- Closed
- relates to
-
RHPAM-3189 EJB timers - Duplicate process instances with "Start Timer" event
- Closed