Automated install of BPEL SE in a GlassFish Cluster
When you install BPEL SE with persistence enabled into a standalone GlassFish node, its persistence schema gets installed automatically. But if you are installing BPEL SE into a cluster, you need to first install the persistence schema manually.
You can install the BPEL SE persistence schema in a couple ways:
- Create the tables using the create_bpelse_tables.sql script located here: create_bpelse_tables.sql
- First install BPEL SE into the server node. This will automatically create the database tables. Then you can uninstall BPEL SE from the server node. This will still leave the database tables intact. Then you could install it into a cluster.
You can do the 2nd method above using the asadmin commandline tool. This technique enables you to automate the installation of BPEL SE by putting all the asadmin commands into a single script. I have created such a script to demonstrate this: Installing BPEL SE in GlassFish Cluster Demo
Once you unzip this archive, edit the setenv.bat file to point to the dir where you installed GlassFish (do not include glassfish root dir at the end of this path) with the cluster profile and run the install-bpel-se-cluster.bat file to install.
The zip archive comes with the sample versions of the BPEL SE (bpelserviceengine.jar) and the required shared library sun-shared-util-library (sharedutillib.jar). If you want to use the latest BPEL SE and the required shared libraries, you can pick them up from here and replace: BPEL SE
Refer the resources at the end of this entry for further reading on clustering BPEL SE.
Following is the breakdown of the commands executed by asadmin in my script. The longer commands are broken down into multiple lines here for readability.
1. Starting the Derby Database Server and the GlassFish Domain
start-database
start-domain
2. Createing JDBC Connection Pools and Resources
create-jdbc-connection-pool
--datasourceclassname org.apache.derby.jdbc.ClientDataSource
--restype javax.sql.DataSource
--property portNumber=1527:password=pass2:user=usr2:serverName=localhost:databaseName=bpelseDB:connectionAttributes=\\;create\\=true derby-nonxa
create-jdbc-connection-pool
--datasourceclassname org.apache.derby.jdbc.ClientDataSource
--restype javax.sql.XADataSource
--property portNumber=1527:password=pass2:user=usr2:serverName=localhost:databaseName=bpelseDB:connectionAttributes=\\;create\\=true derby-xa
create-jdbc-resource
--connectionpoolid derby-nonxa --description "Non XA JDBC Resource Used by BPELSE" --target server jdbc/bpelseNonXA
create-jdbc-resource
--connectionpoolid derby-xa
--description "XA JDBC Resource Used by BPELSE"
--target server jdbc/bpelseXA
3. Install BPEL SE on server node
install-jbi-shared-library --target domain sharedutillib.jar
install-jbi-shared-library --target server sun-shared-util-library
install-jbi-component --target server --properties PersistenceEnabled=true bpelserviceengine.jar
start-jbi-component --target server sun-bpel-engine
4. Uninstall BPEL SE from server node
stop-jbi-component --target server sun-bpel-engine
shut-down-jbi-component --target server sun-bpel-engine
uninstall-jbi-component --target server --force=true sun-bpel-engine
5. Create and Start Cluster
create-cluster Cluster1
create-node-agent Cluster1NA
create-instance
--cluster Cluster1
--nodeagent Cluster1NA
--systemproperties "JMX_SYSTEM_CONNECTOR_PORT=8687
:IIOP_LISTENER_PORT=3330
:IIOP_SSL_LISTENER_PORT=4440
:IIOP_SSL_MUTUALAUTH_PORT=5550
:HTTP_LISTENER_PORT=1110
:HTTP_SSL_LISTENER_PORT=2220" I1
create-instance
--cluster Cluster1
--nodeagent Cluster1NA
--systemproperties "JMX_SYSTEM_CONNECTOR_PORT=8688
:IIOP_LISTENER_PORT=3331
:IIOP_SSL_LISTENER_PORT=4441
:IIOP_SSL_MUTUALAUTH_PORT=5551
:HTTP_LISTENER_PORT=1111
:HTTP_SSL_LISTENER_PORT=2221" I2
start-node-agent --passwordfile passfile.txt Cluster1NA
start-cluster Cluster1
6. Create JDBC Resource Refs in Cluster
create-resource-ref --target Cluster1 jdbc/bpelseNonXA
create-resource-ref --target Cluster1 jdbc/bpelseXA
7. Install and Start BPEL SE in Cluster
install-jbi-shared-library --target Cluster1 sun-shared-util-library
install-jbi-component --target Cluster1 --properties PersistenceEnabled=true bpelserviceengine.jar
start-jbi-component --target Cluster1 sun-bpel-engine
Resources
- Clustering Open ESB/GlassFish ESB Composite Applications (JBI Service Assemblies)
- GlassFish ESB Download
- GlassFish V2 UR2 b04(Final Build) Download: glassfish-installer-v2ur2-b04-windows.jar
- BPEL SE Download
- Architecture and Design Document of BPEL Service Engine Support for clustering and Failover
- BPEL SE Clustering Support Example
- Malkit's blog entry "Configuring BPEL SE Clustering on Non-Clustered Glassfish"