Because the version compatibility between Tomcat and Tomcat-redis-session-manager is poor, this article uses the measured and feasible jar and provides the next download; environment is Tomcat7-java7,jar package please download the attachment
First step: Jar Package Preparation
First put the jar package into the Lib directory under the Tomcat root directory (note that it is placed in Tomcat's Lib directory, not the application's lib directory);
Step Two: Modify the configuration
Under Tomcat's conf directory, edit the context.xml configuration file with the following code:
<valve classname= "Com.orangefunction.tomcat.redissessions.RedisSessionHandlerValve"/><manager className = "Com.orangefunction.tomcat.redissessions.RedisSessionManager" host= "localhost" port= "6379" Databa se= "0" maxinactiveinterval= "/>"
Step three: Whether the boot detection is valid
1) Start Redis:redis-server redis.conf
2) Start Tomcat:catalina Run
3) Run access to a project
4) Execute the Redis client: REDIS-CLI
5) Execute the instruction to verify whether the session has been deposited redis:dbsize
This article is from the "Tranquility Zhiyuan" blog, please be sure to keep this source http://lizhuquan0769.blog.51cto.com/2591147/1696504
Redis Redis Learning Note 02_ using Redis to manage the session of a Tomcat cluster