首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 服务器 > Apache >

Apache Http Server与Tomcat实现负载均衡跟集群

2013-09-11 
Apache Http Server与Tomcat实现负载均衡和集群? ???????? ! DOCTYPE?html?PUBLIC?-//W3C//DTD?HTML?4.0

Apache Http Server与Tomcat实现负载均衡和集群

? ??????
Apache Http Server与Tomcat实现负载均衡跟集群?
Apache Http Server与Tomcat实现负载均衡跟集群
?

<! DOCTYPE?html?PUBLIC?"-//W3C//DTD?HTML?4.01?Transitional//EN"?"http://www.w3.org/TR/html4/loose.dtd" >
Apache Http Server与Tomcat实现负载均衡跟集群 < html >
Apache Http Server与Tomcat实现负载均衡跟集群 < head >
Apache Http Server与Tomcat实现负载均衡跟集群 < meta? http-equiv ="Content-Type" ?content ="text/html;?charset=UTF-8" >
Apache Http Server与Tomcat实现负载均衡跟集群 < title > test1 </ title >
Apache Http Server与Tomcat实现负载均衡跟集群 </ head >
Apache Http Server与Tomcat实现负载均衡跟集群 < body >
? <%
?? System.out.println( " =========================== " );
Apache Http Server与Tomcat实现负载均衡跟集群 %>
Apache Http Server与Tomcat实现负载均衡跟集群 </ body >
Apache Http Server与Tomcat实现负载均衡跟集群 </ html >


?

三、集群 (session复制 )

Apache Http Server与Tomcat实现负载均衡跟集群 < head >
Apache Http Server与Tomcat实现负载均衡跟集群 < title > Cluster?App?Test </ title >
Apache Http Server与Tomcat实现负载均衡跟集群 </ head >
Apache Http Server与Tomcat实现负载均衡跟集群 < body >
Apache Http Server与Tomcat实现负载均衡跟集群Server?Info:
?<%
? out.println(request.getLocalAddr()? + ? " ?:? " ? + ?request.getLocalPort()? + ? " <br> " );
Apache Http Server与Tomcat实现负载均衡跟集群 %>
?<%
? out.println( " <br>?ID? " ? + ?session.getId()? + ? " <br> " );
?? // ?如果有新的?Session?属性设置
?? String ?dataName? = ?request.getParameter( " dataName " );
?? if ?(dataName?! = ? null ? && ?dataName.length()? > ? 0 )?{
????? String ?dataValue? = ?request.getParameter( " dataValue " );
???? session.setAttribute(dataName,?dataValue);
? }
? out.print( " <b>Session?列表</b> " );
? Enumeration?e? = ?session.getAttributeNames();
?? while ?(e.hasMoreElements())?{
????? String ?name? = ?( String )?e.nextElement();
????? String ?value? = ?session.getAttribute(name).toString();
???? out.println(name? + ? " ?=? " ? + ?value? + ? " <br> " );
???? System.out.println(name? + ? " ?=? " ? + ?value);
? }
Apache Http Server与Tomcat实现负载均衡跟集群 %>
Apache Http Server与Tomcat实现负载均衡跟集群 < form? action ="test.jsp" ?method ="POST" >
Apache Http Server与Tomcat实现负载均衡跟集群名称: < input? type =text? size =20? name ="dataName" > ? < br >
Apache Http Server与Tomcat实现负载均衡跟集群值: < input? type =text? size =20? name ="dataValue" > ? < br >
Apache Http Server与Tomcat实现负载均衡跟集群 < input? type =submit ></ form >
Apache Http Server与Tomcat实现负载均衡跟集群 </ body >
Apache Http Server与Tomcat实现负载均衡跟集群 </ html >


Apache Http Server与Tomcat实现负载均衡跟集群 < web-app? xmlns:xsi ="http://www.w3.org/2001/XMLSchema-instance" ?xmlns ="http://java.sun.com/xml/ns/javaee" ?xmlns:web ="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" ?xsi:schemaLocation ="http://java.sun.com/xml/ns/javaee?http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" ?id ="WebApp_ID" ?version ="2.5" >
Apache Http Server与Tomcat实现负载均衡跟集群
Apache Http Server与Tomcat实现负载均衡跟集群?? < display-name > test </ display-name >
Apache Http Server与Tomcat实现负载均衡跟集群
Apache Http Server与Tomcat实现负载均衡跟集群?? < distributable />
Apache Http Server与Tomcat实现负载均衡跟集群
Apache Http Server与Tomcat实现负载均衡跟集群?? < welcome-file-list >
Apache Http Server与Tomcat实现负载均衡跟集群
Apache Http Server与Tomcat实现负载均衡跟集群???? < welcome-file > index.html </ welcome-file >
Apache Http Server与Tomcat实现负载均衡跟集群
Apache Http Server与Tomcat实现负载均衡跟集群???? < welcome-file > index.htm </ welcome-file >
Apache Http Server与Tomcat实现负载均衡跟集群
Apache Http Server与Tomcat实现负载均衡跟集群???? < welcome-file > index.jsp </ welcome-file >
Apache Http Server与Tomcat实现负载均衡跟集群
Apache Http Server与Tomcat实现负载均衡跟集群???? < welcome-file > default.html </ welcome-file >
Apache Http Server与Tomcat实现负载均衡跟集群
Apache Http Server与Tomcat实现负载均衡跟集群???? < welcome-file > default.htm </ welcome-file >
Apache Http Server与Tomcat实现负载均衡跟集群
Apache Http Server与Tomcat实现负载均衡跟集群???? < welcome-file > default.jsp </ welcome-file >
Apache Http Server与Tomcat实现负载均衡跟集群
Apache Http Server与Tomcat实现负载均衡跟集群?? </ welcome-file-list >
Apache Http Server与Tomcat实现负载均衡跟集群
Apache Http Server与Tomcat实现负载均衡跟集群 </ web-app >



?
?
?
?
Apache Http Server与Tomcat实现负载均衡跟集群
??? 新窗口的请求转发到了 tomcat2 服务器, session 的 id 为 DD9E6C8181653B9BCCF534FC8760B264.tomcat2 ,根据测试结果可以说明,在不发生服务器关闭的情况下,每个 session 会绑定到同一个服务器中,而不会在服务器间发生复制。

?

热点排行