Redis Redis Learning Note 02_ using Redis to manage the session of a Tomcat cluster

Source: Internet
Author: User

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

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.