Sentinel helps watch over Redis servers to keep them running smoothly. It notices problems and can fix them automatically.
Monitoring with Sentinel in Redis
sentinel monitor <master-name> <ip> <port> <quorum>
master-name: A name you give to the main Redis server.
quorum: Number of Sentinels that must agree a master is down before action.
sentinel monitor mymaster 127.0.0.1 6379 2
sentinel monitor redis-main 192.168.1.10 6380 3
This configuration sets up Sentinel to monitor a Redis master named 'mymaster' at localhost port 6379. It marks the master as down if no response in 5 seconds, sets failover timeout to 10 seconds, and allows one replica to sync in parallel during failover.
sentinel monitor mymaster 127.0.0.1 6379 2 sentinel down-after-milliseconds mymaster 5000 sentinel failover-timeout mymaster 10000 sentinel parallel-syncs mymaster 1
Sentinel needs at least 3 instances running for reliable failover decisions.
Make sure all Sentinels have the same configuration for the monitored masters.
Sentinel automatically promotes a replica to master if the current master fails.
Sentinel watches Redis servers to detect failures automatically.
It can promote replicas to master to keep Redis available.
Use 'sentinel monitor' to tell Sentinel which Redis server to watch.