Tomcat 7 redis cluster session manager

Tomcat 7 redis cluster session manager
pull/1/merge
Ranjith 2016-03-19 21:03:09 +05:30
parent cee0ead739
commit 5683e79295
1 changed files with 27 additions and 29 deletions

View File

@ -7,40 +7,38 @@
* @since 1.0
*/
Pre-requisite:
--------------
1. jedis-2.8.0.jar (Available in - http://central.maven.org/maven2/redis/clients/jedis/2.8.0/jedis-2.8.0.jar)
2. commons-pool2-2.2.jar (Available in - http://central.maven.org/maven2/org/apache/commons/commons-pool2/2.2/commons-pool2-2.2.jar)
3. commons-logging-1.1.jar (Available in - http://central.maven.org/maven2/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar)
Note: Download all the above three jars and move it into tomcat/lib directory
Supports:
* Apache Tomcat 7
Downloads:
Pre-requisite:
1. jedis-2.8.0.jar
2. commons-pool2-2.4.2.jar
3. commons-logging-1.2.jar
Tomcat Redis Cluster Enabled Session Manager jar is available in below location
https://github.com/ran-jit/TomcatRedisClusterEnabledSessionManager/releases/download/1.0/TomcatClusterEnabledRedisSessionManager-1.0.zip
Steps to be done,
-----------------
1. Add Tomcat system property "catalina.home"
catalina.home="TOMCAT_ROOT_LOCATION"
example: c:/ranjith/apache-tomcat-8.0.32
1. Move the downloaded jars to tomcat/lib directory
* $catalina.home/lib/
2. Add tomcat system property "catalina.base"
* catalina.base="TOMCAT_LOCATION"
2. Download the TomcatRedisSessionManager-1.1.jar
Available in -
3. Extract downloaded jar (TomcatClusterEnabledRedisSessionManager-1.0.jar) to configure Redis credentials in RedisDataCache.properties file and move the file to tomcat/conf directory
* tomcat/conf/RedisDataCache.properties
3. Move the downloaded jar (TomcatRedisSessionManager-1.1.jar) to tomcat/lib directory
$catalina.home/lib/TomcatRedisSessionManager-1.1.jar
example: c:/ranjith/apache-tomcat-8.0.32/lib/TomcatRedisSessionManager-1.1.jar
4. Add the below two lines in tomcat/conf/context.xml
* <Valve className="com.r.tomcat.session.management.RequestSessionHandlerValve">
* <Manager className="com.r.tomcat.session.management.RequestSessionManager">
4. Extract downloaded jar (TomcatRedisSessionManager-1.1.jar) to configure redis data cache credentials in "RedisDataCache.properties" file and move the file to $catalina.home/conf directory
$catalina.home/conf/RedisDataCache.properties
example: c:/ranjith/apache-tomcat-8.0.32/conf/RedisDataCache.properties
5. Add the below two lines in $catalina.home/conf/context.xml
<Valve className="com.r.tomcat.session.management.RequestSessionHandlerValve" />
<Manager className="com.r.tomcat.session.management.RequestSessionManager" />
6. Verify the session expiration time in $catalina.home/conf/web.xml
<session-config>
<session-timeout>EXPIRATION TIME IN MINUTES</session-timeout>
</session-config>
5. Verify the session expiration time in tomcat/conf/web.xml
* <session-config>
* <session-timeout>60<session-timeout>
* <session-config>
Note:
-----
* This clustering implementation supports, both redis single node and cluster environment based on the RedisDataCache.properties configuration.
* The Redis session manager supports, both single redis master and redis cluster based on the redis.properties configuration.