tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From TianJing <tianj...@genomics.org.cn>
Subject questions on tomcat cluster
Date Mon, 10 Aug 2009 11:51:41 GMT
Hi all,

i am now setting up a cluster with a  httpd-2.2.13 and two tomcat 6.0, i
hope to use Session Replication,but there have some problems:
the session can not replication,when a tomcat is disappeared, the session is
lost.

could you please give me some advices? thanks very much!

here is some detail information:

i set the cluser at engine level,and my routing table is :
Destination     Gateway         Genmask         Flags Metric Ref    Use
Iface
255.255.255.255 0.0.0.0         255.255.255.255 UH    0      0        0 eth0
224.0.0.4       0.0.0.0         255.255.255.255 UH    0      0        0 eth1


my configure file is as follow:


########workers.properties configuration
workers.java_home=/usr/java/latest
worker.list=controller
# Set properties for worker1;
worker.worker1.type=ajp13
worker.worker1.host=localhost
worker.worker1.port=8999
worker.worker1.lbfactor=50
worker.worker1.cachesize=10
worker.worker1.cache_timeout=600
worker.worker1.socket_keepalive=1
worker.worker1.socket_timeout=300
worker.worker1.redirect=worker2
# Set properties for worker2;
worker.worker2.type=ajp13
worker.worker2.host=192.168.8.129
worker.worker2.port=8999
worker.worker2.lbfactor=50
worker.worker2.cachesize=10
worker.worker2.cache_timeout=600
worker.worker2.socket_keepalive=1
worker.worker2.socket_timeout=300
worker.worker2.redirect=worker1
# Define the LB worker
worker.controller.type=lb
worker.controller.balance_workers=worker1,worker2
worker.controller.sticky_session=true

########apache vhost:
<VirtualHost *:80>
    ServerAdmin xxxx.xxxx.xxxx
    #DocumentRoot "/share/bccdata/Cloud/src"
    DirectoryIndex  home.xhtml index.htm index.jsp index.php
    ServerName xxx.xxx.xxx.xxx
    JkMountFile /scratch/apache2.2.13/conf/worker.conf
    ErrorLog "logs/cloud-error.log"
    CustomLog "logs/cloud-access_log" common
</VirtualHost>

#######worker.conf
/*=controller


##tomcat1 server.xml on server1
    <Engine name="Catalina" defaultHost="xxx.xxxxx.xxx.xx"
jvmRoute="controller">
      <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
             resourceName="UserDatabase"/>
        <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"
channelSendOptions="8">
                <!--<Manager
className="org.apache.catalina.ha.session.BackupManager"
                                 expireSessionsOnShutdown="false"
                                 notifyListenersOnReplication="true"
                                 mapSendOptions="6"/>-->
                <Manager
className="org.apache.catalina.ha.session.DeltaManager"
                                 expireSessionsOnShutdown="false"
                                 notifyListenersOnReplication="true"/>

                 <Channel
className="org.apache.catalina.tribes.group.GroupChannel">
                 <Membership
className="org.apache.catalina.tribes.membership.McastService"
                                         address="224.0.0.4"
                                         port="45564"
                                     frequency="500"
                                     dropTime="3000"/>
                 <Receiver
className="org.apache.catalina.tribes.transport.nio.NioReceiver"
                                   address="auto"
                                   port="4000"
                               selectorTimeout="100"
                                   maxThreads="6"/>
                 <Sender
className="org.apache.catalina.tribes.transport.ReplicationTransmitter">
                 <Transport
className="org.apache.catalina.tribes.transport.nio.PooledParallelSender"/>
                 </Sender>
             <Interceptor
className="org.apache.catalina.tribes.group.interceptors.TcpFailureDetector"/>
             <Interceptor
className="org.apache.catalina.tribes.group.interceptors.MessageDispatch15Interceptor"/>
                 <Interceptor
className="org.apache.catalina.tribes.group.interceptors.ThroughputInterceptor"/>
                 </Channel>
                 <Valve
className="org.apache.catalina.ha.tcp.ReplicationValve"

filter=".*\.gif;.*\.js;.*\.jpg;.*\.png;.*\.htm;.*\.html;.*\.css;.*\.txt;"/>

        <Deployer className="org.apache.catalina.ha.deploy.FarmWarDeployer"
                                  tempDir="/tmp/war-temp/"
                                  deployDir="/tmp/war-deploy/"
                                  watchDir="/tmp/war-listen/"
                                  watchEnabled="false"/>
                <ClusterListener
className="org.apache.catalina.ha.session.JvmRouteSessionIDBinderListener"/>
                <ClusterListener
className="org.apache.catalina.ha.session.ClusterSessionListener"/>
            </Cluster>
  <Host name="xxx.xxx.xxx.xxx" debug="0" appBase="webapps" unpackWARs="true"
autoDeploy="true">
    <Context path="" docBase="Test"  debug="0" reloadable="false"
distributable="true"/>
 </Host>

    </Engine>


##tomcat2 server.xml on server2
    <Engine name="Catalina" defaultHost="xxx.xxx.xxx.xxx"
jvmRoute="controller">
      <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
             resourceName="UserDatabase"/>
    <!--<Engine name="Catalina" defaultHost="localhost">-->

        <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"
channelSendOptions="8">
                <!--<Manager
className="org.apache.catalina.ha.session.BackupManager"
                                 expireSessionsOnShutdown="false"
                                 notifyListenersOnReplication="true"
                                 mapSendOptions="6"/>-->
                <Manager
className="org.apache.catalina.ha.session.DeltaManager"
                                 expireSessionsOnShutdown="false"
                                 notifyListenersOnReplication="true"/>

                 <Channel
className="org.apache.catalina.tribes.group.GroupChannel">
                <Membership
className="org.apache.catalina.tribes.membership.McastService"
                                         address="224.0.0.4"
                                         port="45564"
                                     frequency="500"
                                     dropTime="3000"/>
                 <Receiver
className="org.apache.catalina.tribes.transport.nio.NioReceiver"
                                   address="auto"
                                   port="4000"
                               selectorTimeout="100"
                                   maxThreads="6"/>
                 <Sender
className="org.apache.catalina.tribes.transport.ReplicationTransmitter">
                 <Transport
className="org.apache.catalina.tribes.transport.nio.PooledParallelSender"/>
                 </Sender>
             <Interceptor
className="org.apache.catalina.tribes.group.interceptors.TcpFailureDetector"/>
             <Interceptor
className="org.apache.catalina.tribes.group.interceptors.MessageDispatch15Interceptor"/>
                 <Interceptor
className="org.apache.catalina.tribes.group.interceptors.ThroughputInterceptor"/>
                 </Channel>
                 <Valve
className="org.apache.catalina.ha.tcp.ReplicationValve"

filter=".*\.gif;.*\.js;.*\.jpg;.*\.png;.*\.htm;.*\.html;.*\.css;.*\.txt;"/>

        <Deployer className="org.apache.catalina.ha.deploy.FarmWarDeployer"
                                  tempDir="/tmp/war-temp/"
                                  deployDir="/tmp/war-deploy/"
                                  watchDir="/tmp/war-listen/"
                                  watchEnabled="false"/>
                <ClusterListener
className="org.apache.catalina.ha.session.JvmRouteSessionIDBinderListener"/>
                <ClusterListener
className="org.apache.catalina.ha.session.ClusterSessionListener"/>
            </Cluster>
  <Host name="xxxx.xxx.xxx.xxx" debug="0" appBase="webapps"
unpackWARs="true" autoDeploy="true">
    <Context path="" docBase="Test"  debug="0" reloadable="false"
distributable="true"/>
 </Host>

    </Engine>


-- 
Tianjing

Bioinformatics Center,
Beijing Genomics Institute,Shenzhen
Tel:+86-755-25273851
MSN:tianjing217@hotmail.com <MSN%3Atianjing217@hotmail.com>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message