集成的客户端
1)lettuce方式集成
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-pool2</artifactId>
</dependency>
<dependency>
<groupId>io.lettuce</groupId>
<artifactId>lettuce-core</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-redis</artifactId>
</dependency>
2) jedis方式集成
<dependency>
<groupId>redis.clients</groupId>
<artifactId>jedis</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-redis</artifactId>
</dependency>
集成模式
1)standalone方式集成
spring:
redis:
host: 127.0.0.1
port: 6379
password: 123456
timeout: 10000
database: 0
lettuce:
# jedis:
pool:
maxIdle: 8
minIdle: 0
maxActive: 8
maxWait: 10000 # 使用负值表示没有限制
2)sentinel方式集成
spring:
redis:
password: 123456
timeout: 10000
database: 0
sentinel:
master: mymaster
nodes:
- 127.0.0.1:6001
- 127.0.0.1:6002
lettuce:
pool:
maxIdle: 8
minIdle: 2
maxActive: 16
maxWait: 10000
3)cluster方式集成
来源:oschina
链接:https://my.oschina.net/u/4198095/blog/4489691