1.
代码语言:javascript
复制#增加配置类 自动开启
@Configuration
@EnableRedisHttpSession
public class RedisSessionManager {
}
2.
代码语言:javascript
复制#依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
<version>2.4.5</version>
</dependency>
<dependency>
<groupId>org.springframework.session</groupId>
<artifactId>spring-session-data-redis</artifactId>
</dependency>
3.
代码语言:javascript
复制spring
redis:
cluster:
nodes: 127.0.0.1:6379,127.0.0.1:6380,127.0.0.1:6381,127.0.0.1:6389,127.0.0.1:6390,192.168.37.129:639