Git Product home page Git Product logo

tomcatredisclusterenabledsessionmanager's Introduction

Tomcat-Redis-Cluster-Enabled-Session-Manager

Redis session manager is pluggable one. It uses to store sessions into Redis for easy distribution of HTTP Requests across a cluster of Tomcat servers. Sessions are implemented as as non-sticky i.e, each request is forwarded to any server in round-robin manner.

The HTTP Requests session setAttribute(name, value) method stores the session into Redis (must be Serializable) immediately and the session getAttribute(name) method request directly from Redis. Also, the inactive sessions has been removed based on the session time-out configuration.

It supports, both single redis master and redis cluster based on the redis.properties configuration.

Going forward, we no need to enable sticky session (JSESSIONID) in Load balancer.

Supports:

  • Apache Tomcat 7

Downloads:

Tomcat Redis Cluster Enabled Session Manager is available

https://github.com/ran-jit/TomcatRedisClusterEnabledSessionManager/releases/download/1.0/TomcatRedisSessionManager-1.0.zip

Pre-requisite:

  1. jedis-3.0.0-SNAPSHOT.jar
  2. commons-pool2-2.2.jar
  3. commons-logging-1.1.jar
Note: Download all the above three jars and move it into tomcat/lib directory

####Steps to be done,

  1. Move the downloaded jar (RedisSessionManager.jar) to tomcat/lib directory

    • $catalina.home/lib/RedisSessionManager.jar
  2. Add tomcat system property "catalina.home"

    • catalina.home="TOMCAT_LOCATION"
  3. Extract downloaded jar (RedisSessionManager.jar) to configure redis credentials in redis.properties file and move the file to tomcat/conf directory

    • tomcat/conf/redis.properties
  4. Add the below two lines in tomcat/conf/context.xml

    • <Valve className="com.r.tomcat.session.management.commons.SessionHandlerValve" />
    • <Manager className="com.r.tomcat.session.management.redis.RedisSessionManager" />
  5. Verify the session expiration time in tomcat/conf/web.xml

    • <session-config>
    • <session-timeout>70</session-timeout>
    • </session-config>

###Note:

  • The Redis session manager supports, both single redis master and redis cluster based on the redis.properties configuration.

tomcatredisclusterenabledsessionmanager's People

Contributors

ran-jit avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.