本文最后更新于 129 天前,如有失效请评论区留言。
redis cluster整合
1.引入连接池和redis依赖
<dependency>
<groupId>redis.clients</groupId>
<artifactId>jedis</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
</dependency>
2.编写配置文件
我这里有9个节点,具体的看自己。
spring:
data:
redis:
jedis:
pool:
enabled: true
max-active: 100
max-wait: 2000
max-idle: 500
min-idle: 0
cluster:
nodes: 192.168.10.12:6379,192.168.10.12:6380,192.168.10.12:6381,192.168.10.14:6379,192.168.10.14:6380,192.168.10.14:6381,192.168.10.15:6379,192.168.10.15:6380,192.168.10.15:6381
max-redirects: 5000
3.开机启动看见
完成