|
| Home > Apache Geronimo v2.2 > Documentation > Configuring and administering > Configuring and administering the Apache Geronimo Server > Clustering and farming > WADI Clustering |
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:
clusterNodeName=MyOwnNodeName
Wadi can be configured to use unicast instead of multicast. To accomplish this, multiple additions need to be added to the wadi-cluster module configuraton in config.xml.
To successfully use a unicast configuraton, the multicast broadcast service needs to be disabled using the disableMCastService attribute.
<gbean name="DefaultDispatcherHolder"> <attribute name="disableMCastService">true</attribute> </gbean>
It's possible to specify the receiver port that the DispatcherHolder will listen on for session updates. If no port is specified then the first available port starting at port 4000 will be chosen automatically.
<gbean name="DefaultDispatcherHolder"> <attribute name="disableMCastService">true</attribute> <attribute name="receiverPort">4003</attribute> </gbean>
A list of static members needs to be defined for a static configuration. Each static member will have it's own gbean configuration in config.xml in the wadi-cluster module. The DefaultDispatchHolder takes a reference to the first static member in the list.
<gbean name="DefaultDispatcherHolder"> <attribute name="disableMCastService">true</attribute> <attribute name="receiverPort">4003</attribute> <reference name="staticMember"> <pattern> <groupId>org.apache.geronimo.configs</groupId> <artifactId>wadi-clustering</artifactId> <version>2.2-SNAPSHOT</version> <type>car</type> <name>firstStaticMember</name> </pattern> </reference> </gbean>
Each static member in the configuration needs to be defined in config.xml. A sample configuration follows:
<gbean name="org.apache.geronimo.configs/wadi-clustering/2.2-SNAPSHOT/car?ServiceModule=org.apache.geronimo.configs/wadi-clustering/2.2-SNAPSHOT/car,j2eeType=GBean,name=firstStaticMember" gbeanInfo="org.apache.geronimo.clustering.wadi.WadiStaticMember"> <attribute name="className">org.apache.catalina.tribes.membership.StaticMember</attribute> <attribute name="port">4001</attribute> <attribute name="securePort">-1</attribute> <attribute name="domain">test-domain</attribute> <attribute name="UniqueId">0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0</attribute> <attribute name="host">9.27.163.151</attribute> <reference name="nextWadiStaticMember"> <pattern> <groupId>org.apache.geronimo.configs</groupId> <artifactId>wadi-clustering</artifactId> <version>2.2-SNAPSHOT</version> <type>car</type> <name>secondStaticMember</name> </pattern> </reference> </gbean>
Standard and Geronimo specific deployment descriptors must be updated as follows:
<web-app> ..... <distributable/> ..... </web-app>
<?xml version="1.0" encoding="UTF-8"?> <web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web/jetty-1.2"> <environment> <moduleId> <groupId>yourGroupId</groupId> <artifactId>yourArtifactId</artifactId> <version>YourVersion</version> <type>war</type> </moduleId> </environment> <context-root>/yourPath</context-root> <clustering-wadi/> </web-app>
| If you are using a Tomcat assembly of Geronimo distribution, replace <clustering-wadi/> with <tomcat-clustering-wadi/> element in the deployment plan. |
The two following configurations, shipped out-of-the-box with the JEE5 Jetty assemblies, must be installed for clustering to work:
Tomcat configurations mirror Jetty's ones except that jetty6-X artifact IDs should be replaced by tomcat6-X.
Geronimo uses the OpenEJB container for providing EJB services. And Geronimo now has some basic support for SFSB clustering such as state replication between cluster members. Basically the server cluster members maintain membership information using multicast heartbeats and the ejb client maintains a list of servers to change target server based on availability. Each multicast packet contains a single URI that advertises a service, its group, and its location in the form of "cluster1:ejb:ejbd://thehost:4201".
The Geronimo-specific deployment plan for an EJB application, which is usually packaged as an EJB JAR file, is called "openejb-jar.xml". The openejb-jar.xml deployment plan is used to in conjunction with the ejb-jar.xml Java EE deployment plan to deploy enterprise applications to the Geronimo application server.
To enable WADI clustering for SFSB, add openejb-clustering-wadi into the deployment plan as followed:
<openejb-jar xmlns="http://openejb.apache.org/xml/ns/openejb-jar-2.2" xmlns:sys="http://geronimo.apache.org/xml/ns/deployment-1.2"> ... <openejb-clustering-wadi/> </openejb-jar>
The two following configurations, shipped out-of-the-box with the JEE5 assemblies, must be installed for clustering to work:
|
|
Privacy Policy - Copyright © 2003-2011, The Apache Software Foundation, Licensed under ASL 2.0. |