Configuring GlassFish ESB for Clustering
Configuring the IEP Service Engine for Clustering
You can configure the IEP SE to run in a GlassFish cluster on the same or different machines. You can also configure the SE for high availability and failover at the component level on a standalone GlassFish server. This topic describes configuring the IEP SE on a GlassFish cluster. For information on standalone configuration for high availability and failover, see Configuring Components for Standalone High Availability and Failover.
The IEP SE uses a database to maintain instance information in a cluster. In a clustered environment, an event processor belongs to any one of the live cluster instances at a given time. All instances can receive the incoming messages, and once a message is received it is inserted into the IEP database for further processing. The instance that owns the event processor picks up the event to complete processing. The output is only written by the instance that owns the event processor. If an instance fails, any in-process transactions are taken over by one of the remaining instances and the process is completed. When the failed engine recovers, it continues to process new requests.
The IEP SE is not dependent on any shared libraries.
Note - The servers in a cluster need to be on the same time zone in order to detect whether an instance has failed.
Setting Up the IEP Database
Default connection pools and JDBC resources are automatically created for an IEP Derby database, as are the Derby database and persistence tables once you enable the engine on the cluster. The tables are automatically created for an Oracle database, but you need to manually create the connection pools and JDBC resources for Oracle.
For Derby, you can customize the default connection pools and JDBC resources if necessary, or create new ones for the cluster. IEP uses both XA and non-XA transactions so two connection pools and JDBC resources are required, one for each type.
For more information about creating connection pools and JDBC resources, see JDBC Resources in the Sun GlassFish Enterprise Server 2.1 Administration Guide.
To Set Up the IEP Database
- To setup an Oracle database, do the following (Derby databases do not require setup):
- Copy the Oracle driver (ojdbc5.jar or ojdbc6.jar) from your Oracle installation to GlassFish_Home/lib. Restart the GlassFish server.
- Create an Oracle database instance using the administrative tools provided by Oracle.
- Customize and run the following script to create the IEP user (or use the information in the script as a guide).
- Launch the GlassFish Admin Console.
- Create and configure two connection pools for the database, one for XA transactions and one for non-XA transactions. Point both connection pools to the same database using the same user name and password.
Tip -For Derby, you can use the connection pools that are automatically created when IEP is installed.
- Select Allow Non Component Callers.
- For a Derby database, enter the following properties:
- Host (can be localhost)
- PortNumber (1527 is the default Derby port)
- connectionAttributes (set this to ;create=true to automatically create the Derby database)
- For an Oracle database, enter the following properties:
- URL (the format for the URL is jdbc:oracle:thin:@hostName:portNumber:databaseName)
- Create and configure two JDBC resources for the database, one for XA transactions and one for non-XA transactions. After you enter the name and connection pool, do the following for each resource:
- Under Available Targets, select the cluster and click Add.
- Click OK.
This adds the resource to the cluster and enables the resource on the cluster.
- To create the database tables, complete the procedure below.
Adding the IEP Service Engine to the Cluster
The IEP SE is not dependent on any shared libraries; you only need to add the service engine to the cluster.
To Add the IEP Service Engine to the Cluster
- Add the IEP SE (sun-bpel-engine) to the cluster as described in To Add a GlassFish ESB Component to a Cluster.
- Before you click OK on the Manage Targets page, do the following:
- Under General – Configure Component, specify a value for the Lease Renewal Interval.
Note - The Lease Renewal Interval is the time period in seconds that IEP engines wait before renewing their lease to let the cluster know it is still running (also known as the heartbeat). If an engine does not update within the specified time period, it is considered to be unavailable.
- In the Non XA Data Source Name property, enter the JNDI name of the non-XA JDBC resource that you created earlier.
- In the XA Data Source Name property, enter the JNDI name of the XA JDBC resource that you created earlier.
This is the database that persists state data for business process instances for recovery.
- Update the value of the Database Schema Name property if you created the database using a username other than iepseDB.
- Configure the remaining runtime properties as you typically would for the IEP SE.
For more information, see the Using the IEP Service Engine.
- Verify that the EMS_ENGINES table in the persistence database contains a row for each instance in the cluster.
If the rows do not appear, check the following:
- Both JDBC Resources are enabled on the target cluster.
- The engine is enabled on the target cluster.
If both of the above are enabled, you might need to stop and restart the IEP SE in order for the rows to appear.
Return to GlassFish ESB Documentation Home