Redis存储Tomcat集群的Session

我们要使用tomcat-redis-session-manager这样的第三方库,主页见:

tomcat-redis-session-manager-1.2-tomcat-7.jar
将此jar包放入tomcat的lib中
修改每一个Tomcat实例的context.xml配置文件然后启动即可:
  1. <Valve className="com.orangefunction.tomcat.redissessions.RedisSessionHandlerValve" />  
  2. <Manager className="com.orangefunction.tomcat.redissessions.RedisSessionManager"  
  3.          host="localhost"  
  4.          port="6379"  
  5.          database="0"  
  6.          maxInactiveInterval="60" />  

猜你喜欢

转载自blog.csdn.net/liyanwei1007/article/details/46379595