Red Hat Business Automation Execution Server on Cloud Foundry
On Cloud Foundry:
- Install business-central, if you want to manage your execution cluster. To quickly deploy on a VM or OpenShift use the RHPAM7 Quick Install Demo
- Install cloud foundry client and a local pcfdev or remote service (see: PCF Dev Local Environment Setup)
- Configure
src/main/resources/application.properties
- Update the
kieserver.controllers
to point to the business-central management/controller/repo you deployed in 1, if you want to manage your execution cluster. - Set
cfkieserver.remoterepo.enabled
to true and update the URL, user, and pass for the business-central management/controller/repo you deployed in 1. - Update the user/pass settings as necessary for the system component
- Update the
- Start the process with
./deploy-cf.sh
As a standalone SpringBoot process:
- Install business-central, if you want to manage your execution cluster. To quickly deploy on a VM or OpenShift use the RHPAM7 Quick Install Demo
- Install a local database service. For example, postgres (default), mysql, or other JDBC RDBMS
- Configure
src/main/resources/application.pgsql.properties
- Set
server.address
to your external or bridge IP address - Set your database settings under
spring.datasource.*
- If you want to manage your execution cluster, set
cfkieserver.remoterepo.enabled
to true and update the URL, user, and pass for the business-central management/controller/repo you deployed in 1. - Update the user/pass settings as necessary for the system component
- Set
- Start the process with
./deploy-spring-boot.sh
, which just usesmvn spring-boot:run
with the appropriate properties file
- kie-server: execution service for rules, process, case, event processing, and planning engine. This process can run as a service with execution package deployed to it, or run as an immutable image. (cannot be embedded in CloudFoundry)
- sso provider: kie-server uses java standard interfaces allowing authentication/authorization providers to be integrated.
- controller: service embedded in business-central for deploying and managing clusters of kie-servers. (cannot be embedded in CloudFoundry).
- business-central: management, activity monitoring, and/or authoring. (cannot be embedded in CloudFoundry).
- jbpm database: data source for jbpm process/case current state, process/case audit logs, and supplemental user information
- supplemental reporting datasources
You have several deployment topology options:
- On cloud foundry managed by a remote business-central and controller service (
./deploy-spring-boot.sh
) - As a plain spring-boot app managed by a remote business-central and controller service (
./deploy-cf.sh
) - On cloud foundry as an immutable image
- As an immutable spring-boot app
The kie-server embedded in SpringBoot uses the Narayana transaction manager. Narayana by default journal transaction status to the filesystem in case recovery is necessary. Cloud Foundry 1.12 allows for persistent volumes to be mounted by applications, which is required to use this by default. In addition the spring.jta.narayana.transaction-manager-id
property needs to unique for reach instance of the cf-kie-server.
As an alternative, the following is currently being investigated. Narayana allows the XID journal to be logged to a jdbc database. Currently it doesn't allow for distributed recovery. Cloud Foundry enforces that there is always an application instance with instance index 0
even after node/container failure or after a scale down. So it may be possible to use the cloud.application.instance_index
property to create an HA singleton instance that is responsible for recovering transactions exclusively.
View the full set of process properties from the system, app, and cloud level using Actuator. Go to the http://cf-kie-server-<yourapp>.local.pcfdev.io/env
address, and log in with username admin
, and password asdfasdf
. As you have changed the security settings this may vary, the user must have the ACTUATOR
role to view the environment variables.
For a local pcfdev development environment you can run mysql behind applications. Here is how to connect to the local mysql database to query/manipulate from your local machine. The following should also work for remote environments as well:
- Install a local mysql client
brew install mysql-client
, or 'sudo yum install mysql-client` - Install the CF mysql plugin
cf install-plugin -r "CF-Community" mysql-plugin
- List the mysql database service names
cf services
- Connect to the kie-server mysql database
cf mysql cf-kie-server-db
(adjusting the name as applicable)
More:
- Go to Menu > Design > Pages
- Select the setting tab (icon with three horizontal lines)
- Expand the navigation tree; click the gear icon on 'Design' node; click '+ New Page'
- Select 'Data Sources' from the drop down
- Click the check box
- Got to Menu > Design > Data Sources
- Click '+ Add Datasource'
- Get your URI, username, and password from the
cloud.services.cf-kie-server-db.connection.jdbcurl
property using the\env
actuator page. - Click 'Test Connection' to verify
- Save/Update the connection
- Start process with
./deploy-cf.sh
(Themanifest.yml > JBP_CONFIG_JMX: '{enabled: true}'
setting, plus thecf ssh -N -T -L 5000:localhost:5000 cf-kie-server
command in the deploy script enables jmx connections) - Use
jconsole
and connect tolocalhost:5000
- Use
jvisualvm
and connect tolocalhost:5000
More:
- CloudFoundry: Enabling Java JMX/RMI access for remote containers
- CloudFoundry: Java thread and heap dump analysis on remote containers
- Download JVisualVM
- Java Home in OSX is
/System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/
- Start process with
./deploy-cf.sh
(Themanifest.yml > JBP_CONFIG_DEBUG: '{enabled: true}'
setting, plus thecf ssh -N -T -L 8000:localhost:8000 cf-kie-server
command in the deploy script enables remote debug connections) - Open cf-kie-server in IDEA
- In the Intellij menu, select 'Run > Edit Configuration'
- Click '+' and select 'Remote'
- Set Name to
cf-kie-server-remote-debug
, set host tolocalhost
, and port to8000
- Save and close the configuration
- In the Intellij menu, select 'Run > Debug cf-kie-server-remote-debug'
More:
- PCFDev Local Environment Setup
- PCF Performance Tuning
- CloudFoundry: Enabling Java JMX/RMI access for remote containers
- CloudFoundry: Java thread and heap dump analysis on remote containers
- How to Remotely Debug Java Applications on Cloud Foundry