1、架包
2、tomcat 配置content.xml
单点:
<Valve className="com.orangefunction.tomcat.redissessions.RedisSessionHandlerValve" />
<Manager className="com.orangefunction.tomcat.redissessions.RedisSessionManager"
host="127.0.0.1"
port="6379"
database="0"
maxInactiveInterval="60"/>
主从+哨兵
<Valve className="com.orangefunction.tomcat.redissessions.RedisSessionHandlerValve" />
<Manager className="com.orangefunction.tomcat.redissessions.RedisSessionManager"
sentinelMaster="mymaster"
sentinels="ip:26379,ip:26379,ip:26379"
maxInactiveInterval="60"/>
本文介绍如何在 Tomcat 中配置使用 Redis 来管理 Session 的过程,包括单点及主从+哨兵模式下的配置示例。通过这些配置可以实现 Session 的共享,提高应用的可用性和扩展性。
1004

被折叠的 条评论
为什么被折叠?



