工作中碰到。现记录一下。
JDK1.8,SpringBoot 2.2.5, Spring-boot-data-starter-redis 2.3.3
keywords:springboot data redis, Lettuce, Sentinel
哨兵模式
根据官方文档
RedisSentinelConfiguration
can also be defined with aPropertySource
, which lets you set the following properties:Configuration Properties
spring.redis.sentinel.master
: name of the master node.
spring.redis.sentinel.nodes
: Comma delimited list of host:port pairs.
spring.redis.sentinel.password
: The password to apply when authenticating with Redis Sentinel
pom.xml
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
</dependency>
<dependency>
<groupId>org