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
1) Start Redis Server. 2) Start your Spring Boot Application. 3) Make a Rest Call using any REST client on operations which are get, update & delete. You can use any REST client such as any User Interface, RestTemplate or Postman etc.
Commands. Use “redis-cli” with port 26379 to connect to sentinel. Note: you always want to tail the /var/log/sentinel/sentinel. log on all sentinels to see the cluster interaction.
Launch Sentinel To restart the Redis service, run this command: sudo service redis restart . To start Redis in Sentinel mode, run redis-server /etc/redis/sentinel. conf –sentinel .
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 toRedisConnectionFactorythe 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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With