Tomcat uses Redis storage sharing session

Source: Internet
Author: User
There are several solutions for session sharing in the Tomcat cluster environment, here is a simple solution.
The session is stored using Redis, and the configuration is relatively simple. Web server is Tomcat6
1. Download the jar package:
Commons-pool-1.6.jar
Jedis-2.1.0.jar
Tomcat-redis-session-manager-tomcat6.jar


2. Modify the Content.xml configuration file in the tomcat/conf directory
Add the following content

<valve classname= "Com.radiadesign.catalina.session.RedisSessionHandlerValve"/>    <manager classname= " Com.radiadesign.catalina.session.RedisSessionManager "         host=" localhost "         port=" 6379 "         database=" 8 "         maxinactiveinterval= "/>"

The TOMCAT7 configuration is the same, except that the jar package version is different.


Jar Package DOWNLOAD Link:

Http://pan.baidu.com/s/1i3H4gD3

If there is a need can go to https://github.com/jcoleman/tomcat-redis-session-manager according to the needs of their own packaging jar use.

Tomcat uses Redis storage sharing session

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.