1.基础环境:

jdk1.7

tomcat7

redis

nginx

2.添加依赖的jar包到tomcat的lib目录(http://pan.baidu.com/s/1eRAwN0Q)

tomcat+redis会话共享

3.配置tomcat的context.xml文件

tomcat+redis会话共享

    <Valve className="com.orangefunction.tomcat.redissessions.RedisSessionHandlerValve" />
    <Manager className="com.orangefunction.tomcat.redissessions.RedisSessionManager" 
        host="10.60.10.122"
        port="6379" 
        database="0" 
        maxInactiveInterval="60"/>

 注意:依赖jar包的版本很重要,比如jedis-2.8.2.jar,之前找的是jedis-2.5.2.jar结果出现了问题

相关文章: