ImageVerifierCode 换一换
格式:DOCX , 页数:17 ,大小:583.97KB ,
资源ID:19706821      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/19706821.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(基于modproxy+Apache 2216+Tomcat 7的负载均衡与集群配置文档格式.docx)为本站会员(b****5)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

基于modproxy+Apache 2216+Tomcat 7的负载均衡与集群配置文档格式.docx

1、 If your Tomcat instances are running on the same machine, make sure the tcpListenPort attribute is unique for each instance, in most cases Tomcat is smart enough to resolve this on its own by autodetecting available ports in the range 4000-4100。参照四中的注释 Make sure your web.xml has the element or set

2、at your 参照四 If you are using mod_jk, make sure that jvmRoute attribute is set at your Engine and that the jvmRoute attribute value matches your worker name in workers.properties .用mod_jk的情况,我们可以不管。 Make sure that all nodes have the same time and sync with NTP service! 当使用多台机器时,要保证不同机器时间的同步。原因为tomcat

3、 session复制的一些机制。具体原因看文档。 Make sure that your loadbalancer is configured for sticky session mode. 保证负载均衡软件设置为session sticky模式。四、 详细配置:1. 修改tomcat7_a/conf/server.xml, 我们采用的是默认的配置,在节点下添加:Java代码1. 3. 4. 7. 8. Channelorg.apache.catalina.tribes.group.GroupChannel9. Membershiporg.apache.catalina.tribes.mem

4、bership.McastService10. address=228.0.0.411. port=4556412. frequency=50013. dropTime=300014. Receiverorg.apache.catalina.tribes.transport.nio.NioReceiver15. auto16. 17. color=redport=4000/color18. autoBind=10019. selectorTimeout=500020. maxThreads=621. 22. Senderorg.apache.catalina.tribes.transport.

5、ReplicationTransmitter23. Transportorg.apache.catalina.tribes.transport.nio.PooledParallelSender24. /Sender25. Interceptororg.apache.catalina.tribes.group.interceptors.TcpFailureDetector26. org.apache.catalina.tribes.group.interceptors.MessageDispatch15Interceptor27. /Channel28. 29. Valveorg.apache.

6、catalina.ha.tcp.ReplicationValve30. filter=31. org.apache.catalina.ha.session.JvmRouteBinderValve32. 33. Deployerorg.apache.catalina.ha.deploy.FarmWarDeployer34. tempDir=/tmp/war-temp/35. deployDir=/tmp/war-deploy/36. watchDir=/tmp/war-listen/37. watchEnabled=38. 39. ClusterListenerorg.apache.catali

7、na.ha.session.JvmRouteSessionIDBinderListener40. org.apache.catalina.ha.session.ClusterSessionListener41. /ClusterCluster className= channelSendOptions= Manager className= expireSessionsOnShutdown= notifyListenersOnReplication=Channel className=Membership className= address= port= frequency= dropTim

8、e=Receiver className=tcpListenPort如果是同一机器部署两个tomcat7应用,则修改tomcat7_b为4001,以免冲突. 不同机器下,不用更改此项。 color=redport=/color autoBind= selectorTimeout= maxThreads=Sender className=Transport className=Interceptor className=Valve className= filter=Deployer className= tempDir= deployDir= watchDir= watchEnabled=Cl

9、usterListener className=2. Connector port=8081 protocol=HTTP/1.1 connectionTimeout=20000 redirectPort=8443 修改,仅为了调试方便。3. tomcat7_awebappsclusterWEB-INFweb.xml中加入4. defaultHost=localhosttomcat7_a,添加jvmRoute属性,此项为后面apache负载均衡用到。五、 复制一份tomcat7_a应用,改名为tomcat7_b.只是为了图方便,实际应该复制的是前面的cluster工程。注意以下几点配置就ok.

10、1. 修改tomcat7_a/conf/server.xml 中的Server port属性Server port=8006 shutdown=SHUTDOWN,因为是同一台机器两个tomcat应用,所以改一下。2. 修改connector port=8082 onnectionTimeout= edirectPort=,同理,为了避免同一台机器端口号冲突。部置在不同的机器是不用管的。3. 修改tomcat7_b,此项为后面apache负载均衡用到。4. 修改: className=40015. tomcat7_bebappsclusterWEB-INFweb.xml中加入import=jav

11、a.util.*3. headtitleTest/headbody5. SESSIONID:+session.getId()+);/如果有新的请求,则添加session属性Stringnamerequest.getParameter(nameif(namenull&name.length()0)valuevaluesession.setAttribute(name,value);out.print(bSessionList:/b16. Enumerationnamessession.getAttributeNames();while(names.hasMoreElements()snamena

12、mes.nextElement();session.getAttribute(sname).toString();out.println(value+System.out.println(23. %formaction=testCluster.jspmethod=post名称:inputtype=textsize=20name=值:type=submitvalue=提交/form31. 32. % page contentType= charset=GBK % page import=Cluster Test 0) String value = request.getParameter( se

13、ssion.setAttribute(name, value); out.print(Session List: Enumeration names = session.getAttributeNames(); while (names.hasMoreElements() String sname = names.nextElement(); String value = session.getAttribute(sname).toString(); out.println( sname + = + value+ System.out.println( sname + + value); fo

14、rm action= method= 名称:input type=text size=20 name= 值:input type=submit value=2. 启动tomcat7_a,启动完毕后,启动tomcat7_b 3. 进入http:/localhost:8081/cluster/testCluster.jsp 对应tomcat7_a(8081),登录几次,可看到 4. 另外打开一个浏览器,进入http:8082/cluster/testCluster.jsp对应tomcat7_b(8082),登录name:tomcat_b,value:b value可看到 5. 刷新tomcat7_a(8081)相关页面,可以看到从tomcat7_b提交的值session同步过来了,说明集群成功。第六章. Session集群工作步骤 参

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1