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>

  • 相关阅读:
    java 线程之间的协作 wait()与notifyAll()
    加密web.config中的邮件配置mailSettings
    TCP编程,Socket通讯
    jQuery插件学习笔记
    抹掉Scala的糖衣(14) -- Update Method
    UVA 12034 Race (递推神马的)
    struts2 命名空间 namespace 学习
    Vim -&gt; 移动光标
    【跟我一步一步学Struts2】——Struts2工作流程
    Python中sort以及sorted函数初探
  • 原文地址:https://www.cnblogs.com/chenzhao/p/2519163.html
Copyright © 2011-2022 走看看