web下的tomcat集群
来源:互联网 发布:黑马程序员java教程 编辑:程序博客网 时间:2024/06/15 03:01
1.需要jar包
先检查tomcat下的lib目录有没有下面的三个jar包
catalina-ha-6.0.20.jar
commons-logging-1.0.4.jar
commons-modeler-2.0.1.jar
2.tomcat下Server.xml配置
在<Engine name="Catalina" defaultHost="localhost">该节点内增加如下配置:
<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="45588" ---这个端口可修改几个tomcat配置一致
frequency="500"
dropTime="3000"/>
<Receiver className="org.apache.catalina.tribes.transport.nio.NioReceiver"
address="auto" ---这个地址值是本机ip建议填写auto
port="4000" ---这个端口可修改几个tomcat配置一致
autoBind="100"
selectorTimeout="100"
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>
3.web应用下web.xml配置
在应用的web.xml增加如下配置:
<distributable/>
- web下的tomcat集群
- windows下tomcat的集群
- Linux环境下,web工程基于httpd和tomcat的集群部署
- Linux下使用Apache的Httpd+Mod_jk+Tomcat搭建Web集群服务
- Apache Tomcat Web集群
- Windows环境下,Nginx+tomcat+redis实现web项目集群
- Windows环境下,Nginx+tomcat+redis实现web项目集群
- linux下tomcat集群的负载均衡
- 通过 Terracotta实现基于Tomcat的Web应用集群
- Nginx+Tomcat+Terracotta的Web服务器集群实做
- 通过 Terracotta实现基于Tomcat的Web应用集群
- Nginx+Keepalived+Tomcat之动静分离的web集群
- Nginx+Keepalived+Tomcat之动静分离的web集群
- 通过 Terracotta实现基于Tomcat的Web应用集群
- Nginx+Keepalived+Tomcat之动静分离的web集群
- Linux+Nginx+Tomcat实现Web服务器的负载均衡集群
- Tomcat下配置Web应用程序的虚拟目录
- web工程在tomcat下的部署
- Android系统的开机画面显示过程分析
- 继承和多态有何区别
- mysql中ADDDATE()函数用法
- 迭代器模式
- MongoDB中Query的几个常用方法
- web下的tomcat集群
- js操作单选按钮
- 软件工程:使用路径通配符加载Resource
- linux批量替换文件内容3种方法(perl,sed,shell)
- bug 豆豆整理
- Fedora systemctl 使用
- 浅谈VS2010中CMFCToolBar的用法
- Android getWidth和getMeasuredWidth的正解
- mysql 优化技巧心得一(key_buffer_size设置).