zoukankan      html  css  js  c++  java
  • tomcat集群

    1:修改tomcat的server.xml <conext path=“2个项目形同的path"/>

    <Engine defaultHost="localhost" jvmRoute="jvm2" name="Catalina">
          <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster" hannelSendOptions="8">
                  <Manager className="org.apache.catalina.ha.session.DeltaManager" expireSessionsOnShutdown="false" notifyListenersOnReplication="true"/>
           
                   <Channel className="org.apache.catalina.tribes.group.GroupChannel">
                           <Membership address="228.0.0.4"
                                       className="org.apache.catalina.tribes.membership.McastService"
                                       dropTime="3000"
                                       frequency="500"
                                       port="45564"/>
                           <Receiver address="auto"
                                     autoBind="100"
                                     className="org.apache.catalina.tribes.transport.nio.NioReceiver"
                                     maxThreads="6"
                                     port="4001"
                                     selectorTimeout="5000"/>
                     <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"/>
                     <Valve className="org.apache.catalina.ha.tcp.ReplicationValve"
                    filter=".*\.gif;.*\.js;.*\.jpg;.*\.png;.*\.htm;.*\.html;.*\.css;.*\.txt;"/>
                      <Valve className="org.apache.catalina.ha.session.JvmRouteBinderValve"/>
                  
                     <Deployer className="org.apache.catalina.ha.deploy.FarmWarDeployer" deployDir="/tmp/war-deploy/" tempDir="/tmp/war-temp/" watchDir="/tmp/war-listen/" watchEnabled="false"/>
                              
                     <ClusterListener className="org.apache.catalina.ha.session.JvmRouteSessionIDBinderListener"/>
                               <ClusterListener className="org.apache.catalina.ha.session.ClusterSessionListener"/>
                   
                   </Channel>
                 
                 </Cluster>

    B项目的server.xml

     <Engine defaultHost="localhost" jvmRoute="jvm1" name="Catalina">
          <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster" hannelSendOptions="8">
                <Manager className="org.apache.catalina.ha.session.DeltaManager" expireSessionsOnShutdown="false" notifyListenersOnReplication="true"/>
       
                    <Channel className="org.apache.catalina.tribes.group.GroupChannel">
                           <Membership address="228.0.0.4" className="org.apache.catalina.tribes.membership.McastService" dropTime="3000" frequency="500" port="45564"/>
                       <Receiver address="auto" autoBind="100" className="org.apache.catalina.tribes.transport.nio.NioReceiver" maxThreads="6" port="4000" selectorTimeout="5000"/>
             
                         <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"/>
            
                        <Valve className="org.apache.catalina.ha.tcp.ReplicationValve" filter=""/>
                        <Valve className="org.apache.catalina.ha.session.JvmRouteBinderValve"/>
            
                        <Deployer className="org.apache.catalina.ha.deploy.FarmWarDeployer" deployDir="/tmp/war-deploy/" tempDir="/tmp/war-temp/" watchDir="/tmp/war-listen/" watchEnabled="false"/>
                         <ClusterListener className="org.apache.catalina.ha.session.JvmRouteSessionIDBinderListener"/>
                        <ClusterListener className="org.apache.catalina.ha.session.ClusterSessionListener"/>
             
            </Channel>
          </Cluster>

  • 相关阅读:
    Leetcode 15
    setjmp和longjmp重复使用的问题
    linux的下两种定时器实现
    linux中的信号处理
    【推荐软件】ack
    《代码大全》阅读心得二
    更换svn diff为vimdiff
    unpack的一点使用问题
    【lua】table是否为空的判断
    vi复制部分字符
  • 原文地址:https://www.cnblogs.com/chenzhao/p/2519163.html
Copyright © 2011-2022 走看看