0
0
Redisquery~10 mins

Monitoring with Sentinel in Redis - Step-by-Step Execution

Choose your learning style9 modes available
Concept Flow - Monitoring with Sentinel
Start Sentinel
Sentinel monitors Redis instances
Detects master failure?
NoContinue monitoring
Yes
Sentinel votes for failover
Elect new master
Update clients with new master info
Resume monitoring
Sentinel continuously watches Redis servers, detects failures, elects a new master, and informs clients to keep the system running smoothly.
Execution Sample
Redis
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
This config sets up Sentinel to monitor a Redis master at 127.0.0.1:6379 with quorum 2 and failover timing.
Execution Table
StepActionCondition/CheckResultSystem State Change
1Sentinel starts monitoring masterMaster reachable?YesMonitoring active, no failover
2Master stops respondingMaster reachable?NoSentinel marks master as down
3Sentinel nodes voteQuorum reached?YesFailover process initiated
4Elect new masterElection complete?YesNew master assigned
5Update clientsClients notified?YesClients connect to new master
6Resume monitoringSystem stable?YesMonitoring continues with new master
7Master recoversMaster reachable?YesOld master becomes replica
8ExitFailover complete and stable?TrueSentinel continues monitoring
💡 Failover completes successfully and system stabilizes with new master
Variable Tracker
VariableStartAfter Step 2After Step 3After Step 4After Step 5Final
master_statusupdowndowndowndownreplica
failover_initiatedfalsefalsetruetruetruefalse
current_masteroriginal_masteroriginal_masteroriginal_masternew_masternew_masternew_master
clients_updatedfalsefalsefalsefalsetruetrue
Key Moments - 3 Insights
Why does Sentinel wait for votes before starting failover?
Sentinel waits for quorum votes (see Step 3) to avoid false failovers caused by temporary network issues.
What happens to the old master after failover?
After failover, the old master becomes a replica (see variable 'master_status' final value) to avoid split-brain.
How do clients know about the new master?
Sentinel updates clients after election (Step 5), so they connect to the new master automatically.
Visual Quiz - 3 Questions
Test your understanding
Look at the execution table, at which step does Sentinel mark the master as down?
AStep 1
BStep 3
CStep 2
DStep 4
💡 Hint
Check the 'Result' and 'System State Change' columns in Step 2
According to the variable tracker, what is the value of 'failover_initiated' after Step 3?
Afalse
Btrue
Cundefined
Dnull
💡 Hint
Look at the 'failover_initiated' row under 'After Step 3' column
If the quorum was not reached at Step 3, what would happen next?
ASentinel would continue monitoring without failover
BFailover would start anyway
CClients would be immediately updated
DOld master would become replica
💡 Hint
Refer to the 'Condition/Check' and 'Result' columns at Step 3
Concept Snapshot
Sentinel monitors Redis masters continuously.
If master fails, Sentinel nodes vote (quorum) to confirm.
On quorum, failover elects a new master.
Clients are updated to connect to new master.
Old master becomes replica after recovery.
This ensures high availability automatically.
Full Transcript
Sentinel is a Redis tool that watches over Redis servers to keep them running smoothly. It checks if the master server is working. If the master stops responding, Sentinel nodes vote to confirm the failure. When enough nodes agree, Sentinel starts a failover process to pick a new master. Then, it tells all clients to use the new master. The old master becomes a replica to avoid conflicts. This process helps Redis stay available without manual intervention.