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>

  • 相关阅读:
    通过web端启动关闭服务器程序以及检测程序运行状态
    Windows 自动监听程序,游戏服务器挂掉以后,自动监听程序将其重启起来
    自动监听程序,如果程序挂了,就重启
    删除log
    封装了一个C++类,当程序意外崩溃的时候可以生成dump文件,以便确定错误原因。
    贝塞尔曲线
    golang sql连接池 超时 数据库自动断开 ->127.0.0.1:3 306: wsarecv: An established connection was aborted by the software in your host machine.
    带控制的抢庄牛牛
    龙虎斗控制
    回归模型与房价预测
  • 原文地址:https://www.cnblogs.com/chenzhao/p/2519163.html
Copyright © 2011-2022 走看看