六狼论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博账号登陆

只需一步,快速开始

搜索
查看: 46|回复: 0

tomcat cluster

[复制链接]

升级  12.67%

15

主题

15

主题

15

主题

秀才

Rank: 2

积分
69
 楼主| 发表于 2013-1-29 07:50:42 | 显示全部楼层 |阅读模式
1.vim tomcat/conf/server.xml
    remove comment  <!--<Engine name="Standalone" defaultHost="localhost" jvmRoute="tomcat1">-->
    add comment <!--    <Engine name="Catalina" defaultHost="localhost">-->
 
    add a cluster after <Engine name="Standalone" defaultHost="localhost" jvmRoute="tomcat1">
 
 
<Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"                 channelSendOptions="6">          <Manager className="org.apache.catalina.ha.session.BackupManager"                   expireSessionsOnShutdown="false"                   notifyListenersOnReplication="true"                   mapSendOptions="6" useDirtyFlag="true"/>          <!--          <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="228.0.0.4"                        port="45564"                        frequency="500"                        dropTime="3000"/>            <Receiver className="org.apache.catalina.tribes.transport.nio.NioReceiver"                      address="auto"                      port="5000"                      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.ClusterSessionListener"/>        </Cluster> 2.add <distributable/> to the web.xml of the webapp context
 3. notice that all the session object should implment seriabable interace
您需要登录后才可以回帖 登录 | 立即注册 新浪微博账号登陆

本版积分规则

快速回复 返回顶部 返回列表