Redis sentinel set up with spring boot
According to Add support for Redis Sentinel Configuration GitHub request,
Spring Data Redis 1.4.0 will introduce redis Sentinel support. Sentinels can be configured using
RedisSentinelConfiguration
. When applied toRedisConnectionFactory
the sentinel configuration will be used to determine current master node an perform failover in case a new master is elected.Added new config properties to
RedisProperties
:spring.redis.sentinel.master=mymaster #name of redis server spring.redis.sentinel.nodes=127.0.0.1:26379,127.0.0.1:26380 #deliminated list of sentinels.
I hope this can help you.
Harshana
Software Engineer (Specialized J2EE) based on Colombo Sri Lanka
Updated on June 13, 2022Comments
-
Harshana almost 2 years
I have redis on 1 master and 2 slaves and on each server a sentinel process is running on port 26379
I want to know how to configure a sentinel as master in order to add for below in application.property file.
spring.redis.sentinel.master= spring.redis.sentinel.nodes=
I have redis server 2.8.19 and spring boot 1.3.4, spring-data-redis 1.6.4 jars