目录
1、创建虚拟主机(01-02)相同【192.168.200.121、192.168.200.122】
3、tomcat节点配置TomcatClusterRedisSessionManager方式实现redis共享(01-02)相同
创建虚拟主机(01-02)相同【192.168.200.121、192.168.200.122】
[root@nginx zrlog]# vim /soft/tomcat/conf/server.xml
<Host name="www.test-session.org" appBase="/code/session"
unpackWARs="true" autoDeploy="true">
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
prefix="session_access_log" suffix=".txt"
pattern="%h %l %u %t "%r" %s %b %{X-Forwarded-For}i" />
</Host>
- 创建目录、代码
[root@nginx zrlog]# mkdir /code/session/ROOT -p
[root@nginx zrlog]# vim /code/session/ROOT/index.jsp
<body>
<%
//HttpSession session = request.getSession(true);
System.out.println(session.getCreationTime());
out.println("<br> web01 SESSION ID:" + session.getId() + "<br>");
out.println("Session created is:" + session.getCreationTime() + "<br>");
%>
</body>
LB配置文件【192.168.200.120】
[root@nginx