Multiple Tomcat8 servers use redis to share sessions

Preconditions:

Tomcat is 8.x

JDK 1.8 or above

 

1. Package Redis Session Manager

 

git clone [email protected]:chexagon/redis-session-manager.git
cd redis-session-manager
git checkout redis-session-manager-2.1.0
mvn clean
mvn package

1. Clone the open source project: https://github.com/chexagon/redis-session-manager

2. Switch to a recent release version

3, use maven package

Generate files after packaging:redis-session-manager-2.1.0.jar

2. Export all dependent packages

Find all jar packages according to the package dependencies in the project

Each jar reference structure

Export results

3. Configure Tomcat8

conf/lib/1. Put the packaging results and dependency packages in the directory of tomcat8

conf/context.xml2, configure the file of Tomcat8

Configure the context.xml file

conf/context.xmladd Managernode to file

in:

endpoint is the <redis主机名>:<端口号>format

 

The attachment is the RedisSessionManager Jar package I packaged and its dependent Jar packages.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326359429&siteId=291194637