0
0
Redisquery~10 mins

Sentinel architecture in Redis - Step-by-Step Execution

Choose your learning style9 modes available
Concept Flow - Sentinel architecture
Start: Redis Master
Sentinel Monitors Master
Detects Master Failure?
NoContinue Monitoring
Yes
Sentinel Votes for New Master
Elect New Master
Slaves Reconfigure to New Master
Clients Redirected to New Master
Sentinel Resumes Monitoring
Sentinel watches the master Redis server, detects failure, elects a new master, and updates slaves and clients.
Execution Sample
Redis
SENTINEL MONITOR mymaster 127.0.0.1 6379 2
SENTINEL FAILOVER mymaster
SENTINEL GET-MASTER-ADDR-BY-NAME mymaster
Sentinel monitors a master, triggers failover, and retrieves the current master address.
Execution Table
StepActionCondition/CheckResult/State Change
1Sentinel starts monitoring masterMaster reachable?Yes, monitoring continues
2Master fails (simulated)Master reachable?No, failure detected
3Sentinel nodes communicateQuorum reached?Yes, failover initiated
4Sentinel elects new masterNew master selectedOne slave promoted
5Slaves reconfigureSlaves point to new masterReplication continues
6Clients redirectedClients connect to new masterService restored
7Sentinel resumes monitoringMonitoring activeSystem stable
8EndNo further failureSentinel waits for events
💡 Sentinel stops failover process after new master is elected and system stabilizes
Variable Tracker
VariableStartAfter Step 2After Step 4After Step 6Final
Master StatusUpDownDownDownUp (new master)
Sentinel StateMonitoringDetecting failureFailover in progressFailover completeMonitoring
Slaves ConfigPoint to old masterPoint to old masterOne slave promotedAll point to new masterAll point to new master
Clients ConnectionTo old masterTo old masterFailover ongoingRedirected to new masterConnected to new master
Key Moments - 3 Insights
Why does Sentinel need a quorum before failover?
Sentinel nodes vote to avoid split-brain; quorum ensures majority agree on master failure before promoting a new master (see execution_table step 3).
What happens to slaves during failover?
One slave is promoted to master, and other slaves reconfigure to replicate from the new master (see variable_tracker Slaves Config after step 4 and 6).
How do clients know about the new master?
Clients are redirected to the new master after failover completes, ensuring continuous service (see execution_table step 6 and variable_tracker Clients Connection).
Visual Quiz - 3 Questions
Test your understanding
Look at the execution_table, at which step does Sentinel detect the master failure?
AStep 1
BStep 4
CStep 2
DStep 6
💡 Hint
Check the 'Condition/Check' column for 'Master reachable?' changing to 'No' in execution_table.
According to variable_tracker, what is the state of 'Master Status' after step 4?
AUp (new master)
BDown
CUnknown
DStarting
💡 Hint
Look at the 'Master Status' row under 'After Step 4' in variable_tracker.
If the quorum was not reached, what would happen in the execution_table flow?
ASentinel would continue monitoring without failover
BFailover would proceed anyway
CSlaves would be promoted automatically
DClients would be redirected immediately
💡 Hint
Refer to execution_table step 3 where quorum is checked before failover.
Concept Snapshot
Sentinel architecture monitors Redis master servers.
It detects failures by checking master availability.
Sentinel nodes vote to confirm failure (quorum).
On failure, a slave is promoted to master.
Slaves and clients are reconfigured to new master.
Sentinel resumes monitoring after failover.
Full Transcript
Redis Sentinel architecture involves multiple Sentinel nodes monitoring a Redis master server. They continuously check if the master is reachable. When a failure is detected, Sentinel nodes communicate and vote to confirm the failure, requiring a quorum to avoid mistakes. Once confirmed, Sentinel elects a new master by promoting one of the slaves. The other slaves reconfigure to replicate from the new master, and clients are redirected to connect to the new master. After failover, Sentinel resumes monitoring the new master to maintain high availability.