首页 > 其他 > 详细

tomcat配置集群

时间:2016-08-16 16:20:26      阅读:250      评论:0      收藏:0      [点我收藏+]

在Tomcat中使用集群功能相对简单。最简单的用法是直接在server.xml文件的或节点下添加

<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.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="4000"
                      autoBind="100"
                      selectorTimeout="5000"
                      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"/>
          </Channel>
          <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"
                    tempDir="/tmp/war-temp/"
                    deployDir="/tmp/war-deploy/"
                    watchDir="/tmp/war-listen/"
                    watchEnabled="false"/>
          <ClusterListener className="org.apache.catalina.ha.session.JvmRouteSessionIDBinderListener">
          <ClusterListener className="org.apache.catalina.ha.session.ClusterSessionListener">
        </Cluster>

默认情况下使用DeltaManager会话管理器;使用GroupChannel作为集群通信通道,组播地址和端口为228.0.0.4和45564,使用ReplicationTransmitter作为消息发射器,使用NioReceiver作为消息接收器,另外添加TcpFailureDetector和MessageDispatch15Interceptor两个拦截器;使用ReplicationValve和JvmRouteBinderValve管道阀门;使用FarmWarDeployer作为集群部署器;添加JvmRouteSessionIDBinderListener和ClusterSessionListener集群监听器。

tomcat配置集群

原文:http://blog.csdn.net/wangyangzhizhou/article/details/52220821

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!