springboot2.0整合redis集群,其实好简单
配置
#redis配置
redis:
cluster:
nodes:
- 127.0.0.1:9000
- 127.0.0.1:9001
- 127.0.0.1:9002
- 127.0.0.1:9003
- 127.0.0.1:9004
- 127.0.0.1:9005
timeout: 6000ms
password:
lettuce:
pool:
max-active: 8
max-wait: -1ms
max-idle: 8
min-idle: 0
database: 0
依赖
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-redis</artifactId> </dependency> <!-- 集群需要 --> <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-pool2</artifactId> </dependency>
本文来自博客园,作者:咔咔皮卡丘,转载请注明原文链接:https://www.cnblogs.com/anquing/p/17637950.html