Sentinel helps keep your Redis database safe and working by watching over it and fixing problems automatically.
Sentinel configuration in Redis
sentinel monitor <master-name> <ip> <port> <quorum> sentinel down-after-milliseconds <master-name> <milliseconds> sentinel failover-timeout <master-name> <milliseconds> sentinel parallel-syncs <master-name> <number>
master-name is a name you give to your main Redis server.
quorum is how many Sentinels must agree before switching to a backup.
sentinel monitor mymaster 127.0.0.1 6379 2
sentinel down-after-milliseconds mymaster 5000sentinel failover-timeout mymaster 60000sentinel parallel-syncs mymaster 1This configuration sets up Sentinel to watch a Redis master at 192.168.1.100:6379, requires 2 Sentinels to agree before failover, waits 10 seconds before marking the master down, allows 3 minutes for failover, and syncs one replica at a time.
sentinel monitor mymaster 192.168.1.100 6379 2 sentinel down-after-milliseconds mymaster 10000 sentinel failover-timeout mymaster 180000 sentinel parallel-syncs mymaster 1
Make sure all Sentinel instances have the same configuration for the master name and quorum.
Sentinel configuration is usually placed in a sentinel.conf file and loaded when Sentinel starts.
Changing Sentinel settings requires restarting Sentinel or sending a CONFIG REWRITE command.
Sentinel configuration tells Redis how to watch and protect your main server.
Key settings include the master name, IP, port, quorum, and timing values.
Proper Sentinel setup helps keep your Redis service reliable and automatic.