Tomcat 和 Apache集群笔记

需要手动添加这段:  (标红的为固定写法,如果同一台机器上跑session会出现不能复制的情况,切记)

<!--      
      <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>
      -->
  <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster" channelSendOptions="8">  
          <!--    
            
          <Manager className="org.apache.catalina.ha.session.BackupManager" 
                    expireSessionsOnShutdown="false" 
                    notifyListenersOnReplication="true" 
                    mapSendOptions="8"/> -->  
          <!--   -->  
          <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="4001" 
                      autoBind="100" 
                      selectorTimeout="5000" 
                      maxThreads="6"/>  
            <!-- timeout="60000"-->  
            <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=""/>  
          <Valve className="org.apache.catalina.ha.session.JvmRouteBinderValve"/>  
 
          <ClusterListener className="org.apache.catalina.ha.session.JvmRouteSessionIDBinderListener"/>  
          <ClusterListener className="org.apache.catalina.ha.session.ClusterSessionListener"/>  
        </Cluster>     

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wywffw.html