简体   繁体   English

Tomcat 8 会话复制与 Redis

[英]Tomcat 8 Session Replication with Redis

Can session replication be implemented on Tomcat 8 with redis? Tomcat 8上可以用redis实现会话复制吗? I am not able to find redis session manager jar for tomcat 8!我找不到适用于 tomcat 8 的 redis 会话管理器 jar!

There is a ready solution offered by Redisson framework - Redis based In-Memory Data Grid. Redisson框架提供了一个现成的解决方案 - 基于 Redis 的内存数据网格。

Two steps how to use it:使用方法分两步:

  1. Add RedissonSessionManager into context.xml将 RedissonSessionManager 添加到 context.xml 中

     <Manager className="org.redisson.tomcat.RedissonSessionManager" configPath="${catalina.base}/redisson.yaml" />

configPath - path to Redisson JSON or YAML config. configPath - Redisson JSON 或 YAML 配置的路径。 See configuration wiki page for more details.有关更多详细信息,请参阅配置 wiki 页面

  1. Copy both jars into TOMCAT_BASE/lib directory: redisson-all-3.xxjar and redisson-tomcat-9-3.xxjar将两个 jar 复制到 TOMCAT_BASE/lib 目录: redisson-all-3.xxjarredisson-tomcat-9-3.xxjar

Boost Tomcat Session Manager performance up to 4x times with Redisson PRO version.使用Redisson PRO版本将 Tomcat 会话管理器的性能提升多达4 倍

您应该仔细阅读,这对您有所帮助http://tomcat.apache.org/tomcat-8.0-doc/cluster-howto.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM