0
1
1.1
1.1.1
1.1.2
1.1.3
1.2
1.2.1
1.2.2
1.2.3
1.2.4
1.3
1.3.1
1.3.2
1.4
1.4.1
1.4.2
1.5
2
2.1
2.2
2.3
TableofContentsIntroduction
Deployment
DownloadandInstallation
UseMysqreplacedefaulth2
DisableServerEvent
UseLDAPreplacedefaultPlain-text
ClusteringDesignTime
DownloadandInstallation
ConfigureZooKeeper
ConfigureHelix
ConfigureWildFly/jBPM
ClusteringRunTime
ConfigureQuartz
ConfigureLoadbalancer
Start&Stop
Start
Stop
Scripts
Administration
jBPMServer
Zookeeper
Helix
jBPMClustereddeployment
1
jBPMClustereddeploymentPrimarypurposeofthisdocumentistosetupaclusteredjBPMenvironment.
ClusterArchitecture
Usually,aBPMsystemmainlycontain3components:
1. DesignTimeTools-Usedtodesignprocess,aversioncontrolandaprocesspersisttoolarenecessary,someBPMsystemuseRDBMStodothis,butjBPMusegitforversioncontrol,mavenforpersistfinalprocess,thisalsoforcompatiblewithrecentDevOps,CloudSolution,gitiswelldemonstratebyGithubforversioncontrol,mavenaregreatfordistributingarchiveacrossservers/machines.
2. RuntimeEngine-AbusinessprocessisaabstractionofbusinesslogicandinvolvebusinesspeopleviaHumanbasedTask,sometimethebusinesslogicneedrollbackorre-orchestrate,thatmeansgreatnumberofdatabaseinterationsarenecessary.
3. RDBMS-SomeBPMsystemusestoreproceduretooperatedDatabase,butjBPMuseHibernatewithnativesql
AftertheoverviewofthebasicarchitectureofjBPM,belowfigureisforhowtoclusterjBPM.
Server1andServer2aretwophysicallinuxserver
BothserverspointtoashredMysqldatabase
BothserverspointtoashredMavenrepository
ApacheZookeeperandHelixusedtoreplicateassets(process,datamodules)between2gitrepositories
QuartzJobSchedulerusedtoruncomplexedtimerrelatedprocess
jBPMClustereddeployment
2Introduction
jBPMClusterDeployment
jBPMClustereddeployment
3Deployment
OvervewThissectioncontainhowtodownloadandinstalljBPM6.5version.
TableofContentsDownloadInstallaton
0-UnzipjBPMfullzip1-InstallWildFly2-InstalljBPMconsole3-InstallkieServer4.Setupusergroup5.InstallationValidation
AlternativeOptions
Download
DownloadjBPM6.5(jbpm-6.5.0.Final-installer-full.zip)fromhttp://jbpm.org/download/download.html
Installaton
Note ThissectiondependonaboveDownloadsection.
0-UnzipjBPMfullzip
unzipjbpm-6.5.0.Final-installer-full.zip
Note Ajbpm-installerfolderwillbegenerated,thefollowinginstallationstepsdependonthisfolder.
1-InstallWildFly
ExtractthezipfiletoinstallWildFly
unzipjbpm-installer/lib/jboss-wildfly-10.0.0.Final.zip
Createplaceholderdirectories
ChangeintoWildFlyHome,create2directories:clusteringandinstallation:
cdwildfly-10.0.0.Final/
mkdirclustering
mkdirinstallation
Notetheclusteringandinstallationdirectoryareusedacrossthewholeinstallation,includingclustering,test,etc.clusteringusedtokeepclusterrelatedsoftware,scripts.installationusedtokeepothercli/shellscripts,3rdpartylibaries,etc.
Copyallcli/shellscriptstoWFY_HOME/installation
jBPMClustereddeployment
4DownloadandInstallation
cp*.cli~/wildfly-10.0.0.Final/installation
cp*.sh~/wildfly-10.0.0.Final/installation
2-InstalljBPMconsole
UnzipjbpmconsolewartoWildFlydeploymentfolderandaddadodeployfile:
unzipjbpm-installer/lib/jbpm-console-6.5.0.Final-wildfly-10.0.0.Final.war-d./wildfly-10.0.0.Final/standalone/deployments/jbpm-console.war
touch./wildfly-10.0.0.Final/standalone/deployments/jbpm-console.war.dodeploy
3-InstallkieServer
UnzipkieserverwartoWildFlydeploymentfolderandaddadodeployfile:
unzipjbpm-installer/lib/kie-server-6.5.0.Final-wildfly-10.0.0.Final.war-d./wildfly-10.0.0.Final/standalone/deployments/kie-server.war
touch./wildfly-10.0.0.Final/standalone/deployments/kie-server.war.dodeploy
4.Setupusergroup
ChangeintoWildFlyHome,executeaddusersshellscriptadd-users.sh:
./installation/add-users.sh
Alternatively,executebelowcommandsunderWildFlyHome
./bin/add-user.sh-a-uadmin-ppassword1!-gadmin,analyst,kiemgmt,rest-all,kie-server
./bin/add-user.sh-a-ukrisv-ppassword1!-gadmin,analyst,rest-all,kie-server
./bin/add-user.sh-a-ujohn-ppassword1!-ganalyst,Accounting,PM
./bin/add-user.sh-a-umary-ppassword1!-ganalyst,HR
./bin/add-user.sh-a-usales-rep-ppassword1!-ganalyst,sales
./bin/add-user.sh-a-ujack-ppassword1!-ganalyst,IT
./bin/add-user.sh-a-ukaty-ppassword1!-ganalyst,HR
./bin/add-user.sh-a-usalaboy-ppassword1!-gadmin,analyst,IT,HR,Accounting,rest-all
./bin/add-user.sh-a-ukieserver-ppassword1!-gkie-server
Note Theseusersareusedfortestandusesimpleplaintxtbasedjaasloginmodule,ifuseOpenLDAPserver,thisstepisredundant
5.InstallationValidation
ChangeintoWildflyHome,editbin/standalone.conf,makesureWildFly/jBPMserverhasenoughmemory
-Xms2048m-Xmx2048m-XX:MetaspaceSize=256M-XX:MaxMetaspaceSize=512m
addsystempropertiestodisableimportexampledata
-Dorg.kie.demo=false-Dorg.kie.example=false
startWildFly/jBPMvia
./bin/standalone.sh-b0.0.0.0-bmanagement=0.0.0.0-cstandalone-full.xml
Oncestartfinished,accesshttp://localhost:8080/jbpm-consolewilllogintojBPMconsolewithadmin/admin.
jBPMClustereddeployment
5DownloadandInstallation
AlternativeOptions
Download/InstallProductionBPMSuiteisaalternative.RefertoDownloadandInstallationBPMS6fordetails.
jBPMClustereddeployment
6DownloadandInstallation
What’sitjBPMdefaultconfiguredtouseanexampleh2datasource,thisnotsuitableforproduction.Thissectionincludingsetpsofswitchtomysqlfromdefaulth2.
TableofContentsInstallMysqlonLinuxandcreatejbpmdatabaseSetupMysqlDataSource
AmendDataSourceSwitchfromh2tomysql
InstallMysqlonLinuxandcreatejbpmdatabase
InstallMysqlonLinuxvia:
yuminstallmysql
StartMysqlinLinuxvia:
servicemysqldstart
Logintomysqlwithrootuser,createdatabase,userandgrantprivileges
CREATEDATABASEjbpm;
CREATEUSER'jbpm_user'@'%'IDENTIFIEDBY'jbpm_pass';
GRANTALLPRIVILEGESONjbpm.*TO'jbpm_user'@'%';
Logintomysqlwithjbpm_userimporttheDDLscripttojbpmdatabase
mysql-ujbpm_user-pjbpm<~/work/jbpm/jbpm-installer/db/ddl-scripts/mysql5/mysql5-jbpm-schema.sql
mysql-ujbpm_user-pjbpm<~/work/jbpm/jbpm-installer/db/ddl-scripts/mysql5/quartz_tables_mysql.sql
SetupMysqlDataSource
Downloadmysqldriver(http://dev.mysql.com/downloads/connector/)toWFY_HOME/installation,assumemysql-connector-java-5.1.38.jarbedownloaded.
AddMysqlDriverasaModule
Assumemodule-add-mysql.clialreadybecopytoWFY_HOME/installation,makesureWildFlyServerisrunningandexecute:
./bin/jboss-cli.sh--connect--file=installation/module-add-mysql.cli
CreateMysqlDataSource
Assumecreate-mysql-ds.clialreadybecopytoWFY_HOME/installation,makesureWildFlyServerisrunningandexecute:
./bin/jboss-cli.sh--connect--file=installation/create-mysql-ds.cli
Note Ifabovecliexecutesuccess,youwillfindtheoutputlike"result"⇒[true],iffailed,pleasecheckthedatabasename,user,passward,etc.
jBPMClustereddeployment
7UseMysqreplacedefaulth2
AmendDataSource
Ifwanttochengedatasourceurl,logintoCLIconsole,execute
./bin/jboss-cli.sh--connect
/subsystem=datasources/data-source=MysqlDS:write-attribute(name=connection-url,value="jdbc:mysql://191.168.1.101:3306/jbpm")
/subsystem=datasources/data-source=quartzNotManagedDS:write-attribute(name=connection-url,value="jdbc:mysql://191.168.1.101:3306/jbpm"
Switchfromh2tomysql
MakesureWildFlyServerisshutdwon,navigatetoWildFlyHome,Editstandalone/deployments/jbpm-console.war/WEB-INF/classes/META-INF/persistence.xml,
Locatethe<jta-data-source>tagandchangeittotheJNDInameofyourdatasource,forexample:
<jta-data-source>java:jboss/datasources/MysqlDS</jta-data-source>
Locatethe<properties>tagandchangethehibernate.dialectproperty,forexample:
<propertyname="hibernate.dialect"value="org.hibernate.dialect.MySQL5Dialect"/>
Locatethehibernate.hbm2ddl.auto,chengetheupdatetonone:
<propertyname="hibernate.hbm2ddl.auto"value="none"/>
Assumeswitch-kie-server.clialreadybecopytoWFY_HOME/installation,makesureWildFLyServerisrunningandexecute:
./bin/jboss-cli.sh--connect--file=installation/switch-kie-server.cli
RestartWildFlyServer,tomakesuretheswitchworkfine.
jBPMClustereddeployment
8UseMysqreplacedefaulth2
DisableServerSentEventTherehavebeenreportsthatFirewallsinbetweentheserverandthebrowsercaninterferewithServerSentEvents(SSE)usedbytheWorkbench.Thewillresultsinthe"Loading…"spinnerremainingvisibleandtheWorkbenchfailingtomaterialize.
TodisableServerSentEvent,changeintojBPM/WildFlyhome,createafileErraiService.propertiesunderstandalone/deployments/jbpm-console.war/WEB-INF/classes/,addthefollowinglinecontent
errai.bus.enable_sse_support=false
jBPMClustereddeployment
9DisableServerEvent
SwitchtoLDAPThissectionincludinghowtoconfigurejbpm-consoletouseLDAPforauthenticationandauthorizationofusers.
ChangeintoWildFlyHome,executecreate-security-domain-ldap.clicli:
./bin/jboss-cli.sh--connect--file=installation/create-security-domain-ldap.cli
Editjbpm-console.war/WEB-INF/jboss-web.xml,changesecuritydomaintojbpm-cluster
<jboss-web>
<security-domain>jbpm-cluster</security-domain>
</jboss-web>
Note admin,analyst,reviewerarenecessaryinLDAP.
jBPMClustereddeployment
10UseLDAPreplacedefaultPlain-text
Design-TimeClusteringDesign-timeclusteringmakesuseofApacheHelixandApacheZooKeeper,toshareassets(processes,rules,datamodelobjects)intheGitrepositorybetweenallclusternodes.ThissectionincludingcontentsofhowtosetupDesign-TimeClustering
jBPMClustereddeployment
11ClusteringDesignTime
What’sthis?Thissectionincludingstepstodownloadandsettingaclustering.
TableofContentsDownloadInstallation
Download
ChangeintoWFY_HOME/clusteringdirectory
Downloadzookeeper-3.3.6.tar.gzfromhttp://apache.fayea.com/zookeeper/zookeeper-3.3.6/
wgethttp://apache.fayea.com/zookeeper/zookeeper-3.3.6/zookeeper-3.3.6.tar.gz
Downloadhelix-core-0.6.6-pkg.tarfromhttp://helix.apache.org/0.6.6-docs/download.cgi
Installation
ChangeintoWFY_HOME/clusteringdirectory.
NotetheWFY_HOME/clusteringusedtokeepzookeeper/helixforeachservers.
Extractzookeeper-3.3.6.tar.gztoWFY_HOME/clustering
tar-xvfzookeeper-3.3.6.tar.gz
Extracthelix-core-0.6.6-pkg.tartoWFY_HOME/clustering
tar-xvfhelix-core-0.6.6-pkg.tar-C~/wildfly-10.0.0.Final/clustering/
jBPMClustereddeployment
12DownloadandInstallation
ConfigureApacheZooKeeperChangeintoWFY_HOME/clustering/zookeeper/conf,createazoo.cfgfromsample
cpzoo_sample.cfgzoo.cfg
Editzoo.cfg,addthefollowingcontent
#DefiningZooKeeperensemble.
server.1=localhost:2888:3888
server.2=localhost:2889:3889
AssignanodeIDtoeachmemberthatwillrunZooKeeper.Forexample,use1,2fornode1,node2respectively.TheZooKeepernodeIDisspecifiedinafieldcalledmyidunderthedatadirectoryofZooKeeperoneachnode.Forexample,onnode1,execute:
mkdir/tmp/zookeeper
echo"1">/tmp/zookeeper/myid
StartZookeeper
Changeintozookeeperhomeexecute
./bin/zkServer.shstart
jBPMClustereddeployment
13ConfigureZooKeeper
ConfigureApacheHelixChangeintoWFY_HOME/clustering/helix-core,createthecluster
./bin/helix-admin.sh--zkSvrserver.1:2181,server.2:2181--addClusterjbpm-cluster
Addnodestothecluster
./bin/helix-admin.sh--zkSvrserver.1:2181,server.2:2181--addNodejbpm-clusternode1:12345
./bin/helix-admin.sh--zkSvrserver.1:2181,server.2:2181--addNodejbpm-clusternode2:12346
Addresourcestothecluster.
./bin/helix-admin.sh--zkSvrserver.1:2181,server.2:2181--addResourcejbpm-clustervfs-repo1LeaderStandbyAUTO_REBALANCE
Rebalancetheclusterwiththethreenodes.
./bin/helix-admin.sh--zkSvrserver.1:2181,server.2:2181--rebalancejbpm-clustervfs-repo1
./bin/helix-admin.sh--zkSvrserver.1:2181,server.2:2181--rebalancejbpm-clustervfs-repo2
StarttheHelixcontrollerinallthenodesinthecluster.
./bin/run-helix-controller.sh--zkSvrserver.1:2181,server.2:2181--clusterjbpm-cluster2>&1>./controller.log&
jBPMClustereddeployment
14ConfigureHelix
ConfigeWildFly/jBPMServerConfigureindividualservernodeswithaseriesifSystempropertiestopointtoApacheHelixcontroller.
ConfigeServer1
CreatethefollowingdirectoriesonServer1
mkdir-p/tmp/jbpm/node1
mkdir-p/tmp/jbpm/quartz
Copydesign-time-cluster-server-1.clitoWFY_HOME/installation,makesureWildFLyServerisrunningandexecute:
./bin/jboss-cli.sh--connect--file=installation/design-time-cluster-server-1.cli
Ifwanttoamendsspecificproperty,logintoCLIconsole,ececute
./bin/jboss-cli.sh--connect
/system-property=org.uberfire.cluster.zk:write-attribute(name=value,value="10.66.192.120:2181,10.66.192.121:2181")
ConfigeServer2
CreatethefollowingdirectoriesonServer2
mkdir-p/tmp/jbpm/node2
mkdir-p/tmp/jbpm/quartz
Copydesign-time-cluster-server-2.clitoWFY_HOME/installation,makesureWildFLyServerisrunningandexecute:
./bin/jboss-cli.sh--connect--file=installation/design-time-cluster-server-2.cli
Ifwanttoamendsspecificproperty,logintoCLIconsole,ececute
./bin/jboss-cli.sh--connect
/system-property=org.uberfire.cluster.zk:write-attribute(name=value,value="10.66.192.120:2181,10.66.192.121:2181")
jBPMClustereddeployment
15ConfigureWildFly/jBPM
Run-TimeClusteringTheruntimeclusteringincludingsetupQuartzEnterpriseJobScheduler,kie-servercluster,dashbuildercluser,etc.
jBPMClustereddeployment
16ClusteringRunTime
ConfigureQuartzConfigureQuartzisnecessarytomakesurejBPMclusterworksfine.
Preparedatasource
ThissteparefinishedinSetupdatasourcessection,quartzNotManagedDshouldbeusedinthefollowingconfiguration.
CreateQuartztablesonquartzNotManagedDreferreddatabase.
cpjbpm-installer/db/ddl-scripts/mysql5/quartz_tables_mysql.sqlwildfly-10.0.0.Final/installation/
mysql-ujbpm_user-pjbpm<wildfly-10.0.0.Final/installation/quartz_tables_mysql.sql
CreatetheQuartzconfigurationfilequartz-definition-mysql.properties
Copyitto/tmp/jbpm/quartzwhichcompatiblewithorg.quartz.propertiespropertydefinitioninConfigureWildFly/jBPM.
jBPMClustereddeployment
17ConfigureQuartz
ConfiguringLoadBalancer
Setupapache2inubuntu14.04
apache2install
sudoapt-getinstallapache2
Edit/etc/apache2/apache2.confaddServerName
ServerName192.168.31.103
apacherestart
/etc/init.d/apache2restart
SetuphttpdonRHEL7ThissectionuseApachehttpdwithmod_proxy_balancerasaLoadBalancer,sticksessionareenabled.
httpdinstall
yum-yinstallhttpd
httpdconfiguration
Copyjbpm-cluster.confto/etc/httpd/conf.d
httpdstart
systemctlstarthttpd.service
Oncehttpdstarted,http://localhost:8080/jbpm-console/canusetologintojbpmconsole.
jBPMClustereddeployment
18ConfigureLoadbalancer
StartandStopCluster
jBPMClustereddeployment
19Start&Stop
StartingaClusterStartclusterwiththefollowingorder:
StartZooKeeperservers
./bin/zkServer.shstart
Note Twonodesneedtostartaccordingly.
StartHelixController
./bin/run-helix-controller.sh--zkSvr192.168.31.103:2181,192.168.31.102:2181--clusterjbpm-cluster2>&1>./controller.log&
StartWilFly/jBPMServer
./bin/standalone.sh-b0.0.0.0-bmanagement=0.0.0.0-cstandalone-full.xml2>&1>./console.log&
Note Twoserveraneedtostartaccordingly.
jBPMClustereddeployment
20Start
StoppingaClusterTostopyourcluster,stopthecomponentsinthereversedorderfromstartingit:
StopWilFly/jBPMServer
Eitherusethestopshellscripts,orCtrl+c.
Note Twoserversneedtostopaccordingly.
Alternatively,usejps-lfindthejBPMserverprocess,killtheprocess
$/usr/lib/jvm/jdk1.8.0_111/bin/jps-l
18822/home/ubuntu/wildfly-10.0.0.Final/jboss-modules.jar
$kill-918822
StopHelixController
psaux|grepHelixControllerMain
kill-15
StopZooKeeperserver(s).
./bin/zkServer.shstop
Note Twonodesneedtostopaccordingly.
jBPMClustereddeployment
21Stop
What’sitThissectioncontaincommands&scriptswhichusedinwholedocument.
HowtorundefaultjBPMSample
InstallDemo
antinstall.demo.noeclipse
StartH2
antstart.h2
StartDemo
./bin/standalone.sh--server-config=standalone-full.xml-Dorg.kie.demo=true-Dorg.kie.example=false-Dorg.kie.server.id=default-kieserver-Dorg.kie.server.persistence.ds=java:jboss/datasources/jbpmDS-Dorg.kie.server.controller=http:
Zookeeperconfigure
/home/ubuntu/wildfly-10.0.0.Final/clustering/zookeeper-3.3.6/zookeeper
server.1=192.168.31.103:2888:3888
server.2=192.168.31.102:2889:3889
Helixconfigure
./bin/helix-admin.sh--zkSvr192.168.31.103:2181,192.168.31.102:2181--addClusterjbpm-cluster
./bin/helix-admin.sh--zkSvr192.168.31.103:2181,192.168.31.102:2181--addNodejbpm-clusterjbpm-server-1:12345
./bin/helix-admin.sh--zkSvr192.168.31.103:2181,192.168.31.102:2181--addNodejbpm-clusterjbpm-server-2:12346
./bin/helix-admin.sh--zkSvr192.168.31.103:2181,192.168.31.102:2181--addResourcejbpm-clustervfs-repo1LeaderStandbyAUTO_REBALANCE
./bin/helix-admin.sh--zkSvr192.168.31.103:2181,192.168.31.102:2181--rebalancejbpm-clustervfs-repo1
./bin/helix-admin.sh--zkSvr192.168.31.103:2181,192.168.31.102:2181--rebalancejbpm-clustervfs-repo2
./bin/run-helix-controller.sh--zkSvr192.168.31.103:2181,192.168.31.102:2181--clusterjbpm-cluster2>&1>./controller.log&
jBPMClustereddeployment
22Scripts
jBPMClusterAdministration
Server HomeDirectory
jBPM /home/ubuntu/wildfly-10.0.0.Final/
Zookeeper /home/ubuntu/wildfly-10.0.0.Final/clustering/zookeeper-3.3.6/
Helix /home/ubuntu/wildfly-10.0.0.Final/clustering/helix-core
jBPMClustereddeployment
23Administration
jBPMconsole
http://10.10.103.226:8080/jbpm-console
http://10.10.103.227:8080/jbpm-console
Users/Roles
User Password Role
admin password1! admin,analyst,kiemgmt,rest-all,kie-server
krisv password1! admin,analyst,rest-all,kie-server
john password1! analyst,Accounting,PM
mary password1! analyst,HR
sales-rep password1! analyst,sales
jack password1! analyst,IT
katy password1! analyst,HR
salaboy password1! admin,analyst,IT,HR,Accounting,rest-all
kieserver password1! kie-server
Start
RefertoStartClusterStartWilFly/jBPMServersection.
jBPMClustereddeployment
24jBPMServer
AdminisrationFromCLI
ChangeintoZookeeperhome,connecttoCLI
./bin/zkCli.sh
Refertohttps://zookeeper.apache.org/doc/trunk/zookeeperAdmin.html#The+Four+Letter+WordsforcompletedAdminisrationCommands.
AdminisrationFromjconsole
$/usr/lib/jvm/jdk1.8.0_111/bin/jconsole
Oncestart,selectorg.apache.zookeeper.server.quorum.QuorumPeerMain.
jBPMClustereddeployment
25Zookeeper
AdministrationFromCLI
ChangeintoHelixhome,executeCLIvia
./bin/helix-admin.sh--zkSvr<ZookeeperServerAddress><command><parameters>
Refertohttp://helix.apache.org/0.6.6-docs/tutorial_admin.htmlforcompletedcommandslist.
jBPMClustereddeployment
26Helix