redis安装:xx
nginx安装:xx
步骤:
1.下载tomcat-redis-session-manager相应的jar包,主要有三个:
wget https://github.com/downloads/jcoleman/tomcat-redis-session-manager/tomcat-redis-session-manager-1.2-tomcat-7-Java-7.jar
wget http://central.maven.org/maven2/redis/clients/jedis/2.5.2/jedis-2.5.2.jar
wget http://central.maven.org/maven2/org/apache/commons/commons-pool2/2.0/commons-pool2-2.0.jar
下载完成后拷贝到$TOMCAT_HOME/lib中
2.修改两tomcat的context.xml:
3.在tomcat/webapps/test放一个index.jsp
4.分别访问集群中几台自己的index.jsp,查看session是否一致。
时间: 2024-10-24 17:13:25