0
0
Redisquery~10 mins

Multiple Sentinel instances in Redis - Step-by-Step Execution

Choose your learning style9 modes available
Concept Flow - Multiple Sentinel instances
Start: Deploy Sentinel Instances
Each Sentinel monitors Master
Sentinels communicate with each other
Detect Master failure?
NoContinue monitoring
Yes
Sentinels agree on failover
Promote a Slave to Master
Update configuration and notify clients
Sentinels continue monitoring new Master
Multiple Sentinel instances run independently but communicate to monitor the master, detect failures, agree on failover, and promote a slave to master.
Execution Sample
Redis
# Sentinel instances monitor master
sentinel1 monitor master 127.0.0.1 6379 2
sentinel2 monitor master 127.0.0.1 6379 2
sentinel3 monitor master 127.0.0.1 6379 2

# Sentinels communicate and decide failover
# Promote slave if master down
This setup shows three Sentinel instances monitoring the same master and coordinating failover.
Execution Table
StepSentinel InstanceActionState ChangeResult
1sentinel1Start monitoring masterMonitoring master at 127.0.0.1:6379Sentinel1 active
2sentinel2Start monitoring masterMonitoring master at 127.0.0.1:6379Sentinel2 active
3sentinel3Start monitoring masterMonitoring master at 127.0.0.1:6379Sentinel3 active
4All SentinelsExchange infoShare master statusConsensus on master health
5All SentinelsDetect master failureMaster unreachableFailover condition met
6All SentinelsVote for failoverMajority agree failoverFailover approved
7All SentinelsPromote slaveOne slave promoted to masterNew master active
8All SentinelsNotify clientsClients updated with new masterClients reconnect
9All SentinelsContinue monitoringMonitoring new masterSystem stable
10---Execution ends: failover complete and monitoring continues
💡 Failover completed after majority Sentinel agreement and new master promotion
Variable Tracker
VariableStartAfter Step 4After Step 6After Step 7Final
Master StatusUpUpDownNew Master UpNew Master Up
Sentinel ConsensusNoneHealthyFailover ApprovedFailover DoneMonitoring New Master
Promoted NodeNoneNoneNoneSlave1Slave1
Key Moments - 3 Insights
Why do multiple Sentinels communicate before failover?
They share master status to reach a majority agreement, preventing false failovers (see execution_table step 4 and 6).
What happens if only one Sentinel detects failure?
Failover does not proceed until majority agree, so monitoring continues (see execution_table step 5 and 6).
How do Sentinels know which slave to promote?
They coordinate and select the best slave based on configuration and health (see execution_table step 7).
Visual Quiz - 3 Questions
Test your understanding
Look at the execution_table, at which step do Sentinels agree to start failover?
AStep 6
BStep 4
CStep 5
DStep 7
💡 Hint
Check the 'Action' and 'Result' columns for voting and approval in execution_table step 6.
According to variable_tracker, what is the Master Status after step 7?
AUp
BDown
CNew Master Up
DUnknown
💡 Hint
Look at 'Master Status' row in variable_tracker after step 7.
If Sentinel2 did not start monitoring at step 2, how would the failover process change?
AFailover would require manual intervention
BFailover would still proceed with two Sentinels
CFailover would never start
DSentinel1 would promote itself immediately
💡 Hint
Refer to execution_table steps 1-3 and understand that majority agreement is needed, so two Sentinels can still form majority.
Concept Snapshot
Multiple Sentinel instances run independently but communicate to monitor the master.
They detect failures by exchanging info and agree by majority vote.
On failover, Sentinels promote a slave to master and notify clients.
This coordination prevents false failovers and ensures high availability.
Full Transcript
Multiple Sentinel instances monitor the Redis master independently. They communicate regularly to share the master's health status. When a failure is detected, Sentinels vote to confirm the failure before starting failover. Once a majority agrees, they promote a slave to master and update clients. This process ensures reliable failover and continuous monitoring of the new master.