Hi,

First, I would recommend that you have a good understanding of how Tomcat clustering works. See:

http://tomcat.apache.org/tomcat-5.5-doc/cluster-howto.html

Now..a disclaimer...

All I did was enable the Tomcat clustering and extend it into Geronimo. This means that 99% of it should work. The 1% is the deployment issues. Although I exposed the FarmDeployer, I think there may be issues with it since it may bypass the Geronimo deployment. Although it *might* work...I would think something like this needs to be run through the Geronimo. Rather than spend a tremendous amount of time in this area on the Tomcat code, I would probably recommend that this type of code be a plugin to WADI, since it is my hope that it will ultimately be the eventual clustering and caching solution for Geronimo.

Enabling simple clustering at the Engine level:

In the j2ee-tomcat-plan.xml, lets create a simple clustering Gbean for Tomcat:

    <!-- Cluster -->
<gbean name="TomcatCluster" class="org.apache.geronimo.tomcat.cluster.CatalinaClusterGBean"> <attribute name="className">org.apache.catalina.cluster.tcp.SimpleTcpCluster</attribute>
    </gbean>

Then we need to set the jvmRoute for the Engine (make it different for each Geronimo instance that you run), and set the "CatalinaCluster" attribute...so we want the Engine Gbean to look like the following:

    <!-- Engine -->
<gbean name="TomcatEngine" class="org.apache.geronimo.tomcat.EngineGBean">
        <attribute
name="className">org.apache.geronimo.tomcat.TomcatEngine</attribute>
        <attribute name="initParams">
            name=Geronimo
            defaultHost=0.0.0.0
            jvmRoute=node1
        </attribute>
        <references name="Hosts">
            <pattern>
                <gbean-name>geronimo.server:j2eeType=Host,*</gbean-name>
            </pattern>
        </references>
        <reference name="RealmGBean">
            <name>TomcatJAASRealm</name>
        </reference>
        <reference name="TomcatValveChain">
            <name>FirstValve</name>
        </reference>
        <reference name="CatalinaCluster">
            <name>TomcatCluster</name>
        </reference>
    </gbean>

Reply via email to