Tomcat enables session sharing with Redis

Source: Internet
Author: User

1, download the latest Jedis (a Redis Java client), Tomcat Redis Session Manager and Apache Commons Pool, placed in the Tomcat/lib directory

redis:http://redis.io/

Jredis:https://github.com/xetorthio/jedis

Tomcat Redis Session manager:https://github.com/jcoleman/tomcat-redis-session-manager/downloads

Apache Commons pool:http://commons.apache.org/proper/commons-pool/download_pool.cgi

2, add the following content under the <Context> node of context.xml

<valve classname= "Com.orangefunction.tomcat.redissessions.RedisSessionHandlerValve"/>

<manager classname= "Com.orangefunction.tomcat.redissessions.RedisSessionManager"

Host= "192.168.1.192" <!--optional, default is "localhost"--

password= "ABC" <!--selectable--

Port= "6379" <!--optional, default is "6379"-

database= "0" <!--optional, default is "0"--

maxinactiveinterval= <!--optional, default is "60" (Unit: seconds)--/>


ps:tomcat7+jedis2.4.2 directly using the Tomcat Redis Session Manager package error, download the source code after compiling OK, attachments I use the package

Tomcat enables session sharing with Redis

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.