Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

...

  • Ensure that every object placed in the HTTP session implements java.io.Serializable. The clustering feature serializes the objects when it distributes them to the other nodes in the cluster.
  • The deployment descriptor for your Web application, that is the web.xml file in the Web archive, must indicate that your Web application is distributable. To do this, insert the distributable element in the deployment descriptor.
    Code Block
    XML
    XML
    borderStylesolid
    titleExcerpt from web.xml
    borderStylesolid
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE web-app
        PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
        "http://java.sun.com/dtd/web-app_2_3.dtd">
    
    <web-app>
        <display-name> ... </display-name>
        <description> ... </description>
        <distributable> <distributable/>
      ...
    </web-app>
    

...

For every node in the cluster, update config.xml as follows after the server is stopped

Code Block
XML
XML
borderStylesolid
titleExcerpt from config.xml
borderStylesolid
<gbean name="TomcatEngine">
  <attribute name="initParams">
    name=geronimo
    jvmRoute=nodeId
  </attribute>
</gbean>

...

  • Sample geronimo-web.xml for geronimo 2.1.4 and below
    Code Block
    borderStyle
    XML
    XMLsolid
    titlegeronimo-web.xml
    borderStylesolid
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web/tomcat-2.0.1"
             xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.2">
    
        <dep:environment>
            <dep:moduleId>
            <dep:groupId>org.mygroup</dep:groupId>
            <dep:artifactId>web-cluster-server1</dep:artifactId>
            <dep:version>2.1.1.2</dep:version>
            <dep:type>war</dep:type>
            </dep:moduleId>
            <dep:dependencies/>
            <dep:hidden-classes/>
            <dep:non-overridable-classes/>
        </dep:environment>
    
        <context-root>/servlet-examples-cluster</context-root>
    
        <security-realm-name>geronimo-properties-realm</security-realm-name>
        <security>
            <default-principal>
            <principal name="anonymous" class="org.apache.geronimo.security.realm.providers.GeronimoUserPrincipal"/>
          </default-principal>
          <role-mappings>
            <role role-name="tomcat">
              <principal name="admin" class="org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal"/>
            </role>
          </role-mappings>
        </security>
    
        <cluster>TomcatCluster</cluster>
        <gbean class="org.apache.geronimo.tomcat.cluster.CatalinaClusterGBean" name="TomcatCluster">
            <attribute name="className">org.apache.catalina.ha.tcp.SimpleTcpCluster</attribute>
            <attribute name="initParams">
                managerClassName=org.apache.catalina.ha.session.DeltaManager
                expireSessionsOnShutdown=false
                useDirtyFlag=true
                notifyListenersOnReplication=true
            </attribute>
            <reference name="TomcatValveChain">
                <name>ReplicationValve</name>
            </reference>
            <reference name="ClusterListenerChain">
                <name>ClusterSessionListener</name>
            </reference>
            <reference name="Channel">
                <name>TomcatGroupChannel</name>
            </reference>
        </gbean>
        <gbean class="org.apache.geronimo.tomcat.cluster.ChannelGBean" name="TomcatGroupChannel">
            <attribute name="className">org.apache.catalina.tribes.group.GroupChannel</attribute>
            <attribute name="initParams"/>
            <reference name="Membership">
                <name>TomcatMembership</name>
            </reference>
            <reference name="Receiver">
                <name>TomcatReceiver</name>
            </reference>
            <reference name="Sender">
                <name>TomcatSender</name>
            </reference>
            <reference name="ChannelInterceptor">
                <name>TomcatChannelInterceptor</name>
            </reference>
        </gbean>
        <gbean class="org.apache.geronimo.tomcat.cluster.MembershipServiceGBean" name="TomcatMembership">
            <attribute name="className">org.apache.catalina.tribes.membership.McastService</attribute>
            <attribute name="initParams">
                mcastAddr=228.0.0.4
                mcastPort=45564
                mcastFrequency=500
                mcastDropTime=3000
            </attribute>
        </gbean>
        <gbean class="org.apache.geronimo.tomcat.cluster.ReceiverGBean" name="TomcatReceiver">
            <attribute name="className">org.apache.catalina.tribes.transport.nio.NioReceiver</attribute>
            <attribute name="initParams">
                tcpListenAddress=IPAddressIn
                tcpListenPort=4001
                tcpSelectorTimeout=100
                tcpThreadCount=6
            </attribute>
        </gbean>
        <gbean class="org.apache.geronimo.tomcat.cluster.SenderGBean" name="TomcatSender">
            <attribute name="className">org.apache.catalina.tribes.transport.ReplicationTransmitter</attribute>
            <attribute name="initParams">
                replicationMode=pooled
                waitForAck=true
            </attribute>
        </gbean>
        <gbean class="org.apache.geronimo.tomcat.ValveGBean" name="ReplicationValve">
            <attribute name="className">org.apache.catalina.ha.tcp.ReplicationValve</attribute>
            <attribute name="initParams">filter=.*\.gif;.*\.js;.*\.css;.*\.png;.*\.jpeg;.*\.jpg;.*\.htm;.*\.html;.*\.txt;</attribute>
            <reference name="NextValve">
                <name>JvmRouteBinderValve</name>
            </reference>
        </gbean>
        <gbean class="org.apache.geronimo.tomcat.ValveGBean" name="JvmRouteBinderValve">
            <attribute name="className">org.apache.catalina.ha.session.JvmRouteBinderValve</attribute>
            <attribute name="initParams">enabled=true</attribute>
        </gbean>
        <gbean class="org.apache.geronimo.tomcat.cluster.ClusterListenerGBean" name="ClusterSessionListener">
            <attribute name="className">org.apache.catalina.ha.session.ClusterSessionListener</attribute>
            <reference name="NextListener">
                <name>JvmRouteSessionIDBinderListener</name>
            </reference>
        </gbean>
        <gbean class="org.apache.geronimo.tomcat.cluster.ClusterListenerGBean" name="JvmRouteSessionIDBinderListener">
            <attribute name="className">org.apache.catalina.ha.session.JvmRouteSessionIDBinderListener</attribute>
        </gbean>
        <gbean class="org.apache.geronimo.tomcat.cluster.ChannelInterceptorGBean" name="TomcatChannelInterceptor">
            <attribute name="className">org.apache.catalina.tribes.group.interceptors.TcpFailureDetector</attribute>
        </gbean>
    </web-app>
    
  • Sample geronimo-web.xml for geronimo versions above 2.1.4. This does not include g 2.2
    After applying fix to 2.1 through GERONIMO-4187 there are some modifications which needs to picked up by your configuration through geronimo-web.xml
Code Block
borderStyle
XML
XMLsolid
titlegeronimo-web.xml
borderStylesolid
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web/tomcat-2.0.1"
         xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.2">

    <dep:environment>
        <dep:moduleId>
        <dep:groupId>org.mygroup</dep:groupId>
        <dep:artifactId>web-cluster-server1</dep:artifactId>
        <dep:version>2.1.1.2</dep:version>
        <dep:type>war</dep:type>
        </dep:moduleId>
        <dep:dependencies/>
        <dep:hidden-classes/>
        <dep:non-overridable-classes/>
    </dep:environment>

    <context-root>/servlet-examples-cluster</context-root>

    <security-realm-name>geronimo-properties-realm</security-realm-name>
    <security>
        <default-principal>
        <principal name="anonymous" class="org.apache.geronimo.security.realm.providers.GeronimoUserPrincipal"/>
      </default-principal>
      <role-mappings>
        <role role-name="tomcat">
          <principal name="admin" class="org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal"/>
        </role>
      </role-mappings>
    </security>

    <cluster>TomcatCluster</cluster>
    <gbean class="org.apache.geronimo.tomcat.cluster.CatalinaClusterGBean" name="TomcatCluster">
        <attribute name="className">org.apache.catalina.ha.tcp.SimpleTcpCluster</attribute>
        <attribute name="initParams"/>
        <reference name="TomcatValveChain">
            <name>ReplicationValve</name>
        </reference>
        <reference name="ClusterListenerChain">
            <name>ClusterSessionListener</name>
        </reference>
        <reference name="Channel">
            <name>TomcatGroupChannel</name>
        </reference>
        <reference name="ClusterManager">                 
                 <name>TomcatClusterManager</name>
         </reference>                             
    </gbean>
    <gbean name="TomcatClusterManager" class="org.apache.geronimo.tomcat.cluster.ClusterManagerGBean">         
            <attribute name="className">org.apache.catalina.ha.session.DeltaManager</attribute>
            <attribute 
classname="org.apache.geronimo.tomcat.cluster.ClusterManagerGBean">initParams">name=somename                  
               <attribute                         expireSessionsOnShutdown=false                         
name="className">org.apache.catalina.ha.session.DeltaManager</attribute>
       
     <attribute name="initParams">name=somename                  
                 useDirtyFlag=true              
         expireSessionsOnShutdown=false                                
notifyListenersOnReplication=true                                       
  useDirtyFlag=true          </attribute>    
                                         notifyListenersOnReplication=true   
    </gbean>                                
            </attribute>            

    <gbean class="org.apache.geronimo.tomcat.cluster.ChannelGBean" name="TomcatGroupChannel">
        <attribute name="className">org.apache.catalina.tribes.group.GroupChannel</attribute>
        <attribute name="initParams"/>
            <reference name="Membership">
        </gbean>    <name>TomcatMembership</name>
        </reference>
        <reference name="Receiver">
            <name>TomcatReceiver</name>
        </reference>
               

    <gbean class="org.apache.geronimo.tomcat.cluster.ChannelGBean" <reference name="TomcatGroupChannelSender">
           <attribute name="className">org.apache.catalina.tribes.group.GroupChannel</attribute> <name>TomcatSender</name>
        <attribute name="initParams"/></reference>
        <reference name="MembershipChannelInterceptor">
            <name>TomcatMembership<<name>TomcatChannelInterceptor</name>
        </reference>
    </gbean>
    <reference <gbean class="org.apache.geronimo.tomcat.cluster.MembershipServiceGBean" name="ReceiverTomcatMembership">
            <name>TomcatReceiver</name><attribute name="className">org.apache.catalina.tribes.membership.McastService</attribute>
        </reference>
        <reference<attribute name="SenderinitParams">
            <name>TomcatSender</name>
mcastAddr=228.0.0.4
            </reference>
mcastPort=45564
           <reference name="ChannelInterceptor">mcastFrequency=500
            <name>TomcatChannelInterceptor</name>mcastDropTime=3000
        </reference>attribute>
    </gbean>
    <gbean class="org.apache.geronimo.tomcat.cluster.MembershipServiceGBeanReceiverGBean" name="TomcatMembershipTomcatReceiver">
        <attribute name="className">org.apache.catalina.tribes.transport.membershipnio.McastService<NioReceiver</attribute>
        <attribute name="initParams">
            mcastAddr=228.0.0.4
tcpListenAddress=IPAddressIn
            mcastPorttcpListenPort=455644001
            mcastFrequencytcpSelectorTimeout=500100
            mcastDropTimetcpThreadCount=30006
        </attribute>
    </gbean>
    <gbean class="org.apache.geronimo.tomcat.cluster.ReceiverGBeanSenderGBean" name="TomcatReceiverTomcatSender">
        <attribute name="className">org.apache.catalina.tribes.transport.nio.NioReceiver<ReplicationTransmitter</attribute>
        <attribute name="initParams">
            tcpListenAddressreplicationMode=IPAddressInpooled
            tcpListenPort=4001
            tcpSelectorTimeout=100
   waitForAck=true
         tcpThreadCount=6
        </attribute>
    </gbean>
    <gbean class="org.apache.geronimo.tomcat.cluster.SenderGBeanValveGBean" name="TomcatSenderReplicationValve">
        <attribute name="className">org.apache.catalina.tribesha.transporttcp.ReplicationTransmitter<ReplicationValve</attribute>
        <attribute name="initParams">
            replicationMode=pooled
            waitForAck=true
        </attribute>
    </gbean>
    <gbean class="org.apache.geronimo.tomcat.ValveGBean" name="ReplicationValve">
        <attribute name="className">org.apache.catalina.ha.tcp.ReplicationValve</attribute>
        <attribute name="initParams">filter=.*\.gif;.*\.>filter=.*\.gif;.*\.js;.*\.css;.*\.png;.*\.jpeg;.*\.jpg;.*\.htm;.*\.html;.*\.txt;</attribute>
        <reference name="NextValve">
            <name>JvmRouteBinderValve</name>
        </reference>
    </gbean>
    <gbean class="org.apache.geronimo.tomcat.ValveGBean" name="JvmRouteBinderValve">
        <attribute name="className">org.apache.catalina.ha.session.JvmRouteBinderValve</attribute>
        <attribute name="initParams">enabled=true</attribute>
    </gbean>
    <gbean class="org.apache.geronimo.tomcat.cluster.ClusterListenerGBean" name="ClusterSessionListener">
        <attribute name="className">org.apache.catalina.ha.session.ClusterSessionListener</attribute>
        <reference name="NextListener">
            <name>JvmRouteSessionIDBinderListener</name>
        </reference>
    </gbean>
    <gbean class="org.apache.geronimo.tomcat.cluster.ClusterListenerGBean" name="JvmRouteSessionIDBinderListener">
        <attribute name="className">org.apache.catalina.ha.session.JvmRouteSessionIDBinderListener</attribute>
    </gbean>
    <gbean class="org.apache.geronimo.tomcat.cluster.ChannelInterceptorGBean" name="TomcatChannelInterceptor">
        <attribute name="className">org.apache.catalina.tribes.group.interceptors.TcpFailureDetector</attribute>
    </gbean>
</web-app>

...

Static members in a cluster are defined using org.apache.geronimo.tomcat.cluster.StaticMemberGBean in the deployment plan. You have to specify all static members within the deployment plan to make sure the application is clustered successfully. Refer to the sample code below for a an application-scoped unicast clustering configuration on one node. The sample assumes there are only two static members in a cluster environment.

A few notes for better understanding of the sample deployment plan:

  • Use ReceiverGBean to specify the information of the current node and port number used for communication.
  • Use DisableMcastInterceptor ChannelInterceptorGBeans to disable the multicast cluster configurations.Use ChannelInterceptorGBeans to , and specify how the static member are chained together as you can see the configurations of StaticMember1Interceptor and StaticMember2Interceptor.
  • Use StaticMemberGBean to specify the information of the second static member and port number used for communication.
  • Use TcpPingInterceptor to send a ping to another member periodically. You can manage ping interval by setting the interval attibute for TcpPingInterceptor. It is a good practice to set interval to 240.

To convert this example to a multicast configuration, the DisableMCastInterceptor, StaticMemberInterceptor, and StaticMember definitions

...

should be removed. Also, the value for the

...

address

...

attribute for the

...

ReceiverGBean definition should be changed to

...

auto

...

.

Code Block
XML
XML
borderStylesolid
titleexcerpt from geronimo-web.xml
borderStylesolid
...
    <cluster>TomcatCluster</cluster>
        <gbean name="TomcatCluster" class="org.apache.geronimo.tomcat.cluster.CatalinaClusterGBean">
            <attribute name="className">org.apache.catalina.ha.tcp.SimpleTcpCluster</attribute>
            <attribute name="initParams"/>
            <reference name="ClusterListenerChain"> 
                    <name>TomcatClusterListenerChain</name>
            </reference>
            <reference name="TomcatValveChain">
                    <name>ReplicationValve</name>  
            </reference>
            <reference name="Channel">
                    <name>TomcatChannel</name>
            </reference>
            <reference name="ClusterManager"> 
                    <name>TomcatClusterManager</name>
            </reference>
        </gbean>

        <gbean name="TomcatClusterListenerChain" class="org.apache.geronimo.tomcat.cluster.ClusterListenerGBean">
            <attribute name="className">org.apache.catalina.ha.session.ClusterSessionListener</attribute>
            <attribute name="initParams"/>
        </gbean>

        <gbean name="ReplicationValve" class="org.apache.geronimo.tomcat.ValveGBean">
            <attribute name="className">org.apache.catalina.ha.tcp.ReplicationValve</attribute>
            <attribute name="initParams">.*\.gif;.*\.js;.*\.jpg;.*\.png;.*\.htm;.*\.html;.*\.css;.*\.txt;</attribute>
            <reference name="NextValve">
        			<type>TomcatValve</type>
            	                <name>JvmRouteBinderValve</name>
            </reference>
        </gbean>

        <gbean name="JvmRouteBinderValve" class="org.apache.geronimo.tomcat.ValveGBean">
            <attribute name="className">org.apache.catalina.ha.session.JvmRouteBinderValve</attribute>
            <attribute name="initParams">enabled=true</attribute>
        </gbean>

        <gbean name="TomcatClusterManager" class="org.apache.geronimo.tomcat.cluster.ClusterManagerGBean">
            <attribute name="className">org.apache.catalina.ha.session.DeltaManager</attribute>
            <attribute name="initParams">name=${clusterName}
                                         channelSendOptions=6
                                         expireSessionsOnShutdown=false
                                         notifyListenersOnReplication=true
                                         mapSendOptions=6
            </attribute>
        </gbean>

        <gbean name="TomcatChannel" class="org.apache.geronimo.tomcat.cluster.ChannelGBean">
            <attribute name="className">org.apache.catalina.tribes.group.GroupChannel</attribute>
            <attribute name="initParams"/>
            <reference name="Membership"> 
                    <name>ClusterMembership</name>
            </reference>
            <reference name="Receiver">
                    <name>ClusterReceiver</name>                
            </reference>
            <reference name="Sender">                
                    <name>ClusterSender</name>
            </reference>
            <reference name="ChannelInterceptor">
                    <name>DisableMcastInterceptor</name>                
            </reference>
        </gbean>

        <gbean name="ClusterMembership" class="org.apache.geronimo.tomcat.cluster.MembershipServiceGBean">
            <attribute name="className">org.apache.catalina.tribes.membership.McastService</attribute>
            <attribute name="initParams">address=228.0.0.4
                                         port=45564
                                         frequency=500
                                         dropTime=3000
            </attribute>
        </gbean>

        <gbean name="ClusterReceiver" class="org.apache.geronimo.tomcat.cluster.ReceiverGBean">
            <attribute name="className">org.apache.catalina.tribes.transport.nio.NioReceiver</attribute>
            <attribute name="initParams">address=IPAddress1
                                         port=TCP_port1
                                         selectorTimeout=100
                                         maxThreads=6
            </attribute>
        </gbean>

        <gbean name="ClusterSender" class="org.apache.geronimo.tomcat.cluster.SenderGBean">
            <attribute name="className">org.apache.catalina.tribes.transport.ReplicationTransmitter</attribute>
        </gbean>

        <gbean name="DisableMcastInterceptor" class="org.apache.geronimo.tomcat.cluster.ChannelInterceptorGBean">
            <attribute name="className">org.apache.geronimo.tomcat.interceptor.DisableMcastInterceptor</attribute>
            <attribute name="initParams"/>
            <reference name="NextInterceptor">
                    <name>TcpPingInterceptor</name>                
            </reference>
        </gbean>

        <gbean name="TcpPingInterceptor" class="org.apache.geronimo.tomcat.cluster.ChannelInterceptorGBean">
            <attribute name="className">org.apache.catalina.tribes.group.interceptors.TcpPingInterceptor</attribute>
            <attribute name="initParams">Interval=240</attribute>
            <reference name="NextInterceptor">
                    <name>TcpFailureDetector</name>                
            </reference>
        </gbean>

        <gbean name="TcpFailureDetector" class="org.apache.geronimo.tomcat.cluster.ChannelInterceptorGBean">
            <attribute name="className">org.apache.catalina.tribes.group.interceptors.TcpFailureDetector</attribute>
            <attribute name="initParams"/>
            <reference name="NextInterceptor">                
                    <name>StaticMember1Interceptor</name>                
            </reference>
        </gbean>

        <gbean name="StaticMember1Interceptor" class="org.apache.geronimo.tomcat.cluster.ChannelInterceptorGBean">
            <attribute name="className">org.apache.catalina.tribes.group.interceptors.StaticMembershipInterceptor</attribute>
            <attribute name="initParams"/>
            <reference name="StaticMember">
                    <name>StaticMember2</name>                
            </reference>
            <reference name="NextInterceptor">                
                    <name>MessageDispatch15Interceptor</name> 
            </reference>
        </gbean>

        <gbean name="MessageDispatch15Interceptor" class="org.apache.geronimo.tomcat.cluster.ChannelInterceptorGBean">
            <attribute name="className">org.apache.catalina.tribes.group.interceptors.MessageDispatch15Interceptor</attribute>
            <attribute name="initParams"/>
            <reference name="NextInterceptor">
                    <name>ThroughputInterceptor</name>                
            </reference>
        </gbean>

        <gbean name="ThroughputInterceptor" class="org.apache.geronimo.tomcat.cluster.ChannelInterceptorGBean">
            <attribute name="className">org.apache.catalina.tribes.group.interceptors.ThroughputInterceptor</attribute>
            <attribute name="initParams"/>
        </gbean>

        <gbean name="StaticMember2" class="org.apache.geronimo.tomcat.cluster.StaticMemberGBean">
            <attribute name="className">org.apache.catalina.tribes.membership.StaticMember</attribute>
            <attribute name="initParams">port=TCP_port2
                                         securePort=-1
                                         host=IPAddress2
                                         domain=test-domain
                                         UniqueId={2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
            </attribute>
        </gbean>
...

...

  • IPAddress1 is the IP address or host name of current static member.
  • TCP_port1 is the TCP port on the current node to listen for session replication data from other static members.
  • IPAddress2 is the IP address or host name of the second static member.
  • TCP_port2 is the TCP port on the second static member to listen for session replication data from other static members.

Configuration

...

of unicast clustering with more than two nodes

To set up an application-scoped unicast clustering with more than two nodes, ensure that make sure you have done following steps.

...

defined all the static members in the deployment plan for each server node.

Interceptors can perform actions when a message is sent or received. Use a reference

...

NextInterceptor

...

in interceptor configurations to chain

...

interceptors together. You can control how the client requests are processed by arranging the order of the interceptor chain.

...

In the following sample code, when the TcpFailureDetector intercepter catches errors, it calls the next interceptor StaticMember1Interceptor. The static member referenced inside StaticMember1Interceptor, static member 2 in this example, will immediately take over the work of the first static member.

Code Block

...

XML
XML

...

titleexcerpt of interceptor chain
borderStylesolid

...
<gbean name="

...

TcpFailureDetector" class="org.apache.geronimo.tomcat.cluster.ChannelInterceptorGBean">
 	 <attribute name="className">org.apache.catalina.

...

tribes.

...

group.

...

interceptors.

...

TcpFailureDetector</attribute>
 	 <attribute name="initParams"/>
 	 <reference name="NextInterceptor">
 	      

...

<name>StaticMember1Interceptor</name>
 	 </reference>
 	 </gbean>
 	 
 	 <gbean name="

...

StaticMember1Interceptor" class="org.apache.geronimo.tomcat.cluster.ChannelInterceptorGBean">
 	 <attribute name="className">org.apache.catalina.tribes.group.interceptors.

...

StaticMembershipInterceptor</attribute>
 	 <attribute name="initParams"

...

/

...

>
 	 <reference name="

...

StaticMember">
 	      

...

<name>StaticMember2</name>
 	 </reference>
 	 

...

<reference name="NextInterceptor">
 	      <name>MessageDispatch15Interceptor</name>
 	 </reference>
</gbean>
...

All the static members involved should be defined in the deployment plan as well as the relationship between these static members. Use a reference NextStaticMember in the definition of each static member, except for the last one, to chain static members together. When static member 2 in this example fails to take over the work, static member 3 will immediately take over the work. It is the same for longer static member chain. When a static member fails to take over the work of the previous static member, it calls the next static member in the chain. The request is passed along until a static member can handle the work or it gets to the end.

Code Block
XML
XML
titleexcerpt of static member chain
borderStylesolid

...

...

<gbean name="StaticMember2" class="org.apache.geronimo.tomcat.cluster.StaticMemberGBean">
	  	 <attribute name="className">org.apache.catalina.tribes.membership.StaticMember</attribute>
	  	 <attribute name="initParams">port=TCP_port2
	  	                              securePort=-1
	  	  

...

  

...

 

...

  

...

                       host=IPAddress2
	  	                              domain=test-domain
	  	                              UniqueId={2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
	  	 </attribute>
	  	

...

 <reference name="NextStaticMember">
	 	   

...

    <name>StaticMember3</name>
	  	 

...

</reference>

...

</gbean> 
...

See the following deployment plan snippet as an a complete example of setting up application-scoped unicast clustering with more than two nodes.

Code Block
XML
XMLborderStylesolid
titleexcerpt from geronimo-web.xml
borderStylesolid
...
 	 <cluster>TomcatCluster</cluster>
 	 <gbean name="TomcatCluster" class="org.apache.geronimo.tomcat.cluster.CatalinaClusterGBean">
 	     <attribute name="className">org.apache.catalina.ha.tcp.SimpleTcpCluster</attribute>
 	     <attribute name="initParams">managerClassName=org.apache.catalina.ha.session.DeltaManager
 	  expireSessionsOnShutdown=false
 	 useDirtyFlag=true
 	 notifyListenersOnReplication=true
 	 </attribute>
 	 <reference name="ClusterListenerChain">
 	 <name>TomcatClusterListenerChain</name>
 	 </reference>
 	 <reference name="TomcatValveChain">
 	 <name>ReplicationValve</name>
 	 </reference>
 	 <reference name="Channel">
 	 <name>TomcatChannel</name>
 	 </reference>
 	 </gbean>    expireSessionsOnShutdown=false
 	 
 	 <gbean name="TomcatClusterListenerChain" class="org.apache.geronimo.tomcat.cluster.ClusterListenerGBean">
 	 <attribute name="className">org.apache.catalina.ha.session.ClusterSessionListener</attribute>
 	 <attribute name="initParams"/>
 	 </gbean>
 	 
 	 <gbean name="ReplicationValve" class="org.apache.geronimo.tomcat.ValveGBean">
 	 <attribute name="className">org.apache.catalina.ha.tcp.ReplicationValve</attribute>
 	 <attribute name="initParams">.*\.gif;.*\.js;.*\.jpg;.*\.png;.*\.htm;.*\.html;.*\.css;.*\.txt;                                  useDirtyFlag=true
 	                                  notifyListenersOnReplication=true
 	     </attribute>
 	     <reference name="NextValveClusterListenerChain">
 	 <type>TomcatValve</type>
 	 <name>JvmRouteBinderValve<          <name>TomcatClusterListenerChain</name>
 	     </reference>
 	     <reference name="TomcatValveChain">
 	           <name>ReplicationValve</name>
 	     </reference>
 	     <reference name="Channel">
 	           <name>TomcatChannel</name>
 	     </reference>
 	 </gbean>
 	 
 	 <gbean name="JvmRouteBinderValveTomcatClusterListenerChain" class="org.apache.geronimo.tomcat.ValveGBeancluster.ClusterListenerGBean">
 	    <attribute name="className">org.apache.catalina.ha.session.JvmRouteBinderValve<ClusterSessionListener</attribute>
 	 <attribute   <attribute name="initParams">enabled=true</attribute>>
 	 </gbean>
 	 
 	 <gbean name="TomcatChannelReplicationValve" class="org.apache.geronimo.tomcat.cluster.ChannelGBeanValveGBean">
 	    <attribute name="className">org.apache.catalina.tribesha.grouptcp.GroupChannel<ReplicationValve</attribute>
 	    <attribute name="initParams"/>>.*\.gif;.*\.js;.*\.jpg;.*\.png;.*\.htm;.*\.html;.*\.css;.*\.txt;</attribute>
 	    <reference name="MembershipNextValve">
 	 <name>ClusterMembership</name>        <type>TomcatValve</type>
 	  </reference>
  	 <reference name="Receiver">
 	 <name>ClusterReceiver<<name>JvmRouteBinderValve</name>
 	 </reference>
 	 <reference name="Sender">
 	 <name>ClusterSender</name>
 	    </reference>
 	 <reference name="ChannelInterceptor">
 	 <name>DisableMcastInterceptor</name>
 	 </reference>
 	 </gbean>
 	 
 	 <gbean name="ClusterMembershipJvmRouteBinderValve" class="org.apache.geronimo.tomcat.cluster.MembershipServiceGBeanValveGBean">
 	    <attribute name="className">org.apache.catalina.tribesha.membershipsession.McastService<JvmRouteBinderValve</attribute>
 	    <attribute name="initParams">address=228.0.0.4
 	 port=45564
 	 frequency=500
 	 dropTime=3000>enabled=true</attribute>
 	 </attribute>gbean>
 	 </gbean>

 	 <gbean name="ClusterReceiverTomcatChannel" class="org.apache.geronimo.tomcat.cluster.ReceiverGBeanChannelGBean">
 	 <attribute   <attribute name="className">org.apache.catalina.tribes.transportgroup.nio.NioReceiver<GroupChannel</attribute>
 	    <attribute name="initParams">address=IPAddress1/>
 	    <reference port=10200name="Membership">
 	 selectorTimeout=100
 	 maxThreads=6
 	 </attribute>        <name>ClusterMembership</name>
 	    </gbean>reference>
 	 
	 
 	 <gbean<reference name="ClusterSender" class="org.apache.geronimo.tomcat.cluster.SenderGBeanReceiver">
 	 <attribute name="className">org.apache.catalina.tribes.transport.ReplicationTransmitter</attribute>
 	 </gbean>
 	 
 	 <gbean name="DisableMcastInterceptor" class="org.apache.geronimo.tomcat.cluster.ChannelInterceptorGBean">
 	 <attribute name="className">org.apache.geronimo.tomcat.interceptor.DisableMcastInterceptor</attribute>
 	 <attribute name="initParams"/>
 	 <reference name="NextInterceptor">
 	 <name>TcpPingInterceptor</name>
 	         <name>ClusterReceiver</name>
 	    </reference>
 	    <reference name="Sender">
 	         <name>ClusterSender</name>
 	    </reference>
 	    <reference name="ChannelInterceptor">
 	         <name>DisableMcastInterceptor</name>
 	    </reference>
 	 </gbean>
 	 
 	 <gbean name="TcpPingInterceptorClusterMembership" class="org.apache.geronimo.tomcat.cluster.ChannelInterceptorGBeanMembershipServiceGBean">
 	    <attribute name="className">org.apache.catalina.tribes.groupmembership.interceptors.TcpPingInterceptor<McastService</attribute>
 	    <attribute name="initParams">Interval=240</attribute>>address=228.0.0.4
 	 <reference name="NextInterceptor">
 	 <name>TcpFailureDetector</name>
 	 </reference>
 	 </gbean>
 	 
 	 <gbean name="TcpFailureDetector" class="org.apache.geronimo.tomcat.cluster.ChannelInterceptorGBean">
 	 <attribute name="className">org.apache.catalina.tribes.group.interceptors.TcpFailureDetector</attribute>
 	 <attribute name="initParams"/>
 	 <reference name="NextInterceptor">
 	 <name>StaticMember1Interceptor</name>
 	 </reference>
 	 </gbean>
 	 
 	 <gbean name="StaticMember1Interceptor"                                 port=45564
 	                                 frequency=500
 	                                 dropTime=3000
 	    </attribute>
 	 </gbean>

 	 <gbean name="ClusterReceiver" class="org.apache.geronimo.tomcat.cluster.ChannelInterceptorGBeanReceiverGBean">
 	    <attribute name="className">org.apache.catalina.tribes.grouptransport.interceptorsnio.StaticMembershipInterceptor<NioReceiver</attribute>
 	    <attribute name="initParams"/>>address=IPAddress1
 	 <reference name="StaticMember">
 	 <name>StaticMember2</name>
 	 </reference>
 	 <reference name="NextInterceptor">
 	 <name>MessageDispatch15Interceptor</name>
 	 </reference>
 	 </gbean>
 	 
 	 <gbean name="MessageDispatch15Interceptor" class="org.apache.geronimo.tomcat.cluster.ChannelInterceptorGBean">
 	 <attribute name="className">org.apache.catalina.tribes.group.interceptors.MessageDispatch15Interceptor</attribute>
 	 <attribute name="initParams"/>
 	 <reference name="NextInterceptor">
 	 <name>ThroughputInterceptor</name>
 	 </reference>                                port=TCP_port1
 	                                 selectorTimeout=100
 	                                 maxThreads=6
 	    </attribute>
 	 </gbean>
 	 
	 
 	 <gbean name="ThroughputInterceptorClusterSender" class="org.apache.geronimo.tomcat.cluster.ChannelInterceptorGBeanSenderGBean">
 	    <attribute name="className">org.apache.catalina.tribes.grouptransport.interceptors.ThroughputInterceptor<ReplicationTransmitter</attribute>
 	 <attribute name="initParams"/>
 	 </gbean>
 	 
 	 <gbean name="StaticMember2DisableMcastInterceptor" class="org.apache.geronimo.tomcat.cluster.StaticMemberGBeanChannelInterceptorGBean">
 	 <attribute   <attribute name="className">org.apache.catalinageronimo.tribestomcat.membershipinterceptor.StaticMember<DisableMcastInterceptor</attribute>
 	    <attribute name="initParams">port=TCP_port2
	  	 securePort=-1
/>
 	    <reference name="NextInterceptor">
 	  	 host=IPAddress2
	  	 domain=test-domain
	  	 UniqueId={2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
	 </attribute>
	 <reference name="NextStaticMember">
	 <name>StaticMember3</name>
	 <name>TcpPingInterceptor</name>
 	    </reference>
 	 </gbean> 
	  	 
 	 <gbean name="StaticMember3TcpPingInterceptor" class="org.apache.geronimo.tomcat.cluster.StaticMemberGBeanChannelInterceptorGBean">
 	    <attribute name="className">org.apache.catalina.tribes.membershipgroup.interceptors.StaticMember<TcpPingInterceptor</attribute>
 	    <attribute name="initParams">port=TCP_port3
>Interval=240</attribute>
 	 	   	<reference securePort=-1
name="NextInterceptor">
 	 	   	 host=IPAddress3
	 	  	 domain=test-domain
 <name>TcpFailureDetector</name>
 	 	  	 UniqueId={2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
 </reference>
 	 </attribute>gbean>
 	 
 	 <gbean     </gbean>
...
name="TcpFailureDetector" class="org.apache.geronimo.tomcat.cluster.ChannelInterceptorGBean">
 	    <attribute name="className">org.apache.catalina.tribes.group.interceptors.TcpFailureDetector</attribute>
 	    <attribute name="initParams"/>
 	    <reference name="NextInterceptor">
 	         <name>StaticMember1Interceptor</name>
 	    </reference>
 	 </gbean>
 	 
 	 <gbean name="StaticMember1Interceptor" class="org.apache.geronimo.tomcat.cluster.ChannelInterceptorGBean">
 	    <attribute name="className">org.apache.catalina.tribes.group.interceptors.StaticMembershipInterceptor</attribute>
 	    <attribute name="initParams"/>
 	    <reference name="StaticMember">
 	         <name>StaticMember2</name>
 	    </reference>
 	    <reference name="NextInterceptor">
 	         <name>MessageDispatch15Interceptor</name>
 	    </reference>
 	 </gbean>
 	 
 	 <gbean name="MessageDispatch15Interceptor" class="org.apache.geronimo.tomcat.cluster.ChannelInterceptorGBean">
 	    <attribute name="className">org.apache.catalina.tribes.group.interceptors.MessageDispatch15Interceptor</attribute>
 	    <attribute name="initParams"/>
 	    <reference name="NextInterceptor">
 	         <name>ThroughputInterceptor</name>
 	    </reference>
 	 </gbean>
 	 
 	 <gbean name="ThroughputInterceptor" class="org.apache.geronimo.tomcat.cluster.ChannelInterceptorGBean">
 	    <attribute name="className">org.apache.catalina.tribes.group.interceptors.ThroughputInterceptor</attribute>
 	    <attribute name="initParams"/>
 	 </gbean>
 	 
 	 <gbean name="StaticMember2" class="org.apache.geronimo.tomcat.cluster.StaticMemberGBean">
	    <attribute name="className">org.apache.catalina.tribes.membership.StaticMember</attribute>
	    <attribute name="initParams">port=TCP_port2
                                         securePort=-1
	  	                         host=IPAddress2
	  	                         domain=test-domain
	  	                         UniqueId={2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
	    </attribute>
	    <reference name="NextStaticMember">
	         <name>StaticMember3</name>
	    </reference>
	 </gbean> 
	  	 
	 <gbean name="StaticMember3" class="org.apache.geronimo.tomcat.cluster.StaticMemberGBean">
	    <attribute name="className">org.apache.catalina.tribes.membership.StaticMember</attribute>
	    <attribute name="initParams">port=TCP_port3
	 	  	                 securePort=-1
	 	  	                 host=IPAddress3
	 	  	                 domain=test-domain
	 	  	                 UniqueId={2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
	    </attribute>
         </gbean>
...

Where

  • IPAddress1 is the IP address or host name of current static member.
  • TCP_port1 is the TCP port on the current node to listen for session replication data from other static members.
  • IPAddress2 is the IP address or host name of the second static member.
  • TCP_port2 is the TCP port on the second static member to listen for session replication data from other static members.
  • IPAddress3 is the IP address or host name of the third static member.
  • TCP_port3 is the TCP port on the third static member to listen for session replication data from other static members.