WADI Clustering Support
Web-applications and Stateful SessionBeans (Geronimo 2.2+) can be clustered by WADI. In order to cluster these components, their Geronimo deployment descriptors are augmented with specific XML elements. These elements define various clustering parameters controlling how underlying WADI's components are wired and set-up upon application deployment.
The two following configurations, shipped out-of-the-box with JEE5 assemblies, must be installed for clustering to work properly:
- org.apache.geronimo.configs/clustering//car: it defines the runtime dependencies that clustered Web applications or EJB modules must have. For instance, it imports the geronimo-clustering JAR into the classpath of such modules. Also, it defines a Node GBean defining the unique name of this Geronimo instance in the cluster.
In order to give a specific name to your Geronimo instance, this module can be reconfigured by updating the clusterNodeName property defined within var/config/config-substitutions.properties:
- org.apache.geronimo.configs/wadi-clustering//car: it defines WADI specific GBeans used to further configure the behaviour of clustered applications and the WADI group communication service shared by all clustered applications to communicate with each others.
This is in this module, by overriding the DefaultBackingStrategyFactory GBean, that the default number of replicas, 2, to be maintained across the cluster for a given HTTP session or SFSB instance is configured.
These configurations are automatically started when clustered applications are started. Hence, you should not start them explicitly.
Clustering of Web-applications
Updating your Deployment Descriptors
Standard and Geronimo specific deployment descriptors must be updated as follows:
- standard deployment descriptor, i.e. web.xml: the Web application must be marked as distributable. In other words, the optional "distributable" element must be defined:
- Geronimo deployment descriptor, i.e. geronimo-web.xml: if you are deploying the application to embedded Jetty, then the "clustering-wadi" substitution group must be defined. If you are deploying to embedded Tomcat, then you should use the "tomcat-clustering-wadi" substitution group. These substitution groups are defined by the XSDs geronimo-clustering-wadi-X.xsd and geronimo-tomcat-clustering-wadi-X.xsd respectively which are included in the schema folder of a Geronimo server installation.
Both of these elements provide a Web application specific clustering configuration, which overrides the default clustering configuration. This default clustering configuration is defined by the GBean WADIJettyClusteringBuilder declared by org.apache.geronimo.configs/jetty6-clustering-builder-wadi//car.
Here is an example Geronimo deployment descriptor targeted at Jetty embedded:
<?xml version="1.0" encoding="UTF-8"?>
If you are using a Tomcat assembly of Geronimo distribution, replace
<tomcat-clustering-wadi/> element in the deployment plan.
Jetty Web-application Clustering Configurations
The two following configurations, shipped out-of-the-box with the JEE5 Jetty assemblies, must be installed for clustering to work:
- org.apache.geronimo.configs/jetty6-clustering-wadi//car: it defines runtime dependencies and Jetty6 clustering contracts.
- org.apache.geronimo.configs/jetty6-clustering-builder-wadi//car: it defines deployment time dependencies along with a JettyClusteringBuilder GBean declaring the default clustering configuration.
This configuration must be running when a clustered Web-application is started. If it is not, then the substitution group clustering-wadi is not properly recognized and the deployment fails.
Tomcat Web-application Clustering Configurations
Tomcat configurations mirror Jetty's ones except that jetty6-X artifact IDs should be replaced by tomcat6-X.