1 引入依赖
<!-- 引入redis依赖 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
</dependency>
2 集成哨兵
yml配置文件
spring:
redis:
# Redis 哨兵模式
database: 1
password: auskat
sentinel:
master: auskat-master
nodes: 192.168.51.4:26379,192.168.51.5:26379,192.168.51.6:26379
3 集成集群
yml配置文件
spring:
redis:
# Redis 集群模式
password: auskat
cluster:
nodes: 192.168.51.101:6379,192.168.51.102:6379,192.168.51.103:6379,192.168.51.104:6379,192.168.51.105:6379,192.168.51.106:6379
4 相关信息
- 博文不易,辛苦各位猿友点个关注和赞,感谢
网友评论