Configuring GlassFish ESB for Clustering
Configuring the Database Binding Component for Clustering
The Database BC works differently in inbound mode than outbound mode in a cluster. In inbound mode, the database BC distributes records evenly across the instances based on the number of records configured for each poll. For inbound mode, you need to create database tables to manage the instances. In outbound mode, the Database BC works the same in a clustered environment as in a standalone environment. For important failover information, see the Release Notes for GlassFish ESB v2.1.
The Database BC is not dependent on any shared libraries.
Creating the Clustering Database for the Database Binding Component
When using the Database BC in inbound mode in a clustered environment, you need to create a clustering database to manage the load. This is not required for outbound mode.
To Create the Clustering Database for the Database Binding Component
Before You Begin
Create a database instance in which to create the clustering database tables, and make sure it is running.
- Run the following SQL command against the database for each polling table, updating the variables for each table.
create table owner_polling_table (pkname datatype(size) primary key, instance_name varchar(50), status varchar(30))
- polling_table is the name of the polling table
- pkname is the name of the polling table's primary key
- datatype is the data type for the primary key
- size is the length of the primary key column
- Run the following command against the database:
create table instancestate (instanceid varchar(50), lastupdatetime timestamp, tablename varchar(50))
- Create and configure a connection pool for the database (for more information, see JDBC Resources in the Sun GlassFish Enterprise Server 2.1 Administration Guide).
- Create and configure a JDBC resource for the database. When you create the JDBC Resource, select the cluster from the Available Targets list and click Add.
This adds the resource to the cluster and also enables the resource on the cluster.
Adding the Database Binding Component to the Cluster
The Database BC does not depend on any shared libraries, so you only need to add the BC to the cluster.
To Add the Database Binding Component to the Cluster
- Add the Database BC to the cluster as described in To Add a GlassFish ESB Component to a Cluster.
The name of the Database BC node is sun-database-binding.
- Before you click OK on the Manage Targets page, configure the runtime properties:
- Enter the number of outbound threads.
Note - When using a Derby database, be sure to set this to a relatively high number (for example, 100 per 1000 records) or create all cluster-related tables in the same database. Otherwise, a SQL exception may be thrown and the database becomes unusable.
- In the Cluster Database JNDI Name property, enter the name of the JDBC resource you created earlier.
Return to GlassFish ESB Documentation Home