I created a learning project using Spring Data Redis, bitnami/redis and bitnami/redis-sentinel images. The Docker Compose file is here. The deployment command is docker-compose -f redis-sentinel.yaml up --scale redis-sentinel=3 --scale redis-replica=2 -d
, so the Redis configuration is as follows:
After bringing everything up, I stop the master container with docker stop redis-master
. After 10 seconds, the sentinels failover to one of the replicas. So far so good. However, nothing is shown in the container console logs for the following very important things:
- master down has been detected.
- Failover has been initiated.
- Failover has successfully completed.
I was expecting the sentinel to log the aspects indicated above.
Also, when I run sentinel masters
command from the Redis CLI of one of the sentinels, I see no difference in the number of replica before and after failover. I was expecting to see the number drop by 1 when the master is shut down.
31) "num-slaves"
32) "2"
33) "num-other-sentinels"
34) "2"