Bird
Raised Fist0
Redisquery~10 mins

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

Choose your learning style10 modes available
Concept Flow - Multiple Sentinel instances
Start: Deploy Sentinel Instances
↓
Each Sentinel monitors Master
↓
Sentinels communicate with each other
↓
Detect Master failure?
No→Continue 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.

Practice

(1/5)
1.

What is the main role of multiple Redis Sentinel instances working together?

easy
A. They monitor the Redis master and agree before failover.
B. They store data backups for Redis.
C. They increase Redis memory capacity.
D. They replace Redis with a different database.

Solution

  1. Step 1: Understand Sentinel's purpose

    Redis Sentinel instances monitor the health of Redis masters and replicas.
  2. Step 2: Role of multiple Sentinels

    Multiple Sentinels work together to agree on failover decisions to keep Redis available.
  3. Final Answer:

    They monitor the Redis master and agree before failover. -> Option A
  4. Quick Check:

    Sentinel consensus = monitor and agree [OK]
Hint: Sentinels agree before switching masters [OK]
Common Mistakes:
  • Thinking Sentinels store data backups
  • Confusing Sentinels with Redis memory management
  • Believing Sentinels replace Redis entirely
2.

Which of the following is the correct way to configure multiple Sentinel instances to monitor the same Redis master?

sentinel monitor mymaster 127.0.0.1 6379 2

What does the last number 2 represent?

easy
A. The number of Sentinels required to agree for failover.
B. The port number of the Redis master.
C. The maximum number of replicas allowed.
D. The timeout in seconds for Sentinel responses.

Solution

  1. Step 1: Analyze the sentinel monitor command

    The command format is sentinel monitor <name> <ip> <port> <quorum>.
  2. Step 2: Understand the quorum parameter

    The last number specifies how many Sentinels must agree to start failover.
  3. Final Answer:

    The number of Sentinels required to agree for failover. -> Option A
  4. Quick Check:

    Quorum = number of Sentinels to agree [OK]
Hint: Last number in monitor is quorum count [OK]
Common Mistakes:
  • Confusing quorum with port number
  • Thinking it sets replica count
  • Assuming it is a timeout value
3.

Given three Sentinel instances monitoring a Redis master with quorum set to 2, what happens if only one Sentinel detects the master is down?

medium
A. Failover will start immediately.
B. The master will be removed from monitoring.
C. All Sentinels will restart automatically.
D. No failover will occur until at least two Sentinels agree.

Solution

  1. Step 1: Understand quorum in failover

    Quorum defines how many Sentinels must agree the master is down before failover.
  2. Step 2: Apply quorum to scenario

    With quorum 2, one Sentinel alone cannot trigger failover.
  3. Final Answer:

    No failover will occur until at least two Sentinels agree. -> Option D
  4. Quick Check:

    Failover needs quorum agreement [OK]
Hint: Failover needs quorum Sentinels agreeing [OK]
Common Mistakes:
  • Assuming one Sentinel can trigger failover
  • Thinking Sentinels restart automatically
  • Believing master is removed without quorum
4.

Identify the error in this Sentinel configuration snippet:

sentinel monitor mymaster 192.168.1.10 6379 0

What is wrong with the quorum value?

medium
A. Port number 6379 is reserved and cannot be used.
B. IP address is invalid for Sentinel monitoring.
C. Quorum cannot be zero; it must be at least 1.
D. The master name 'mymaster' is not allowed.

Solution

  1. Step 1: Check quorum parameter rules

    Quorum must be a positive integer, at least 1, to allow failover decisions.
  2. Step 2: Analyze given value

    Quorum is set to 0, which is invalid and disables failover agreement.
  3. Final Answer:

    Quorum cannot be zero; it must be at least 1. -> Option C
  4. Quick Check:

    Quorum ≥ 1 for valid failover [OK]
Hint: Quorum must be positive integer ≥ 1 [OK]
Common Mistakes:
  • Setting quorum to zero
  • Confusing IP validity with quorum
  • Thinking port 6379 is invalid
5.

You have 5 Sentinel instances monitoring a Redis master with quorum set to 3. Two Sentinels lose network connectivity and cannot communicate. What is the impact on failover decisions?

hard
A. Sentinels automatically reduce quorum to 2 to allow failover.
B. Failover can still occur if the remaining 3 Sentinels agree.
C. Failover is impossible because a majority of Sentinels are disconnected.
D. The Redis master will shut down automatically.

Solution

  1. Step 1: Understand quorum and Sentinel count

    Quorum is 3, meaning at least 3 Sentinels must agree to failover.
  2. Step 2: Analyze network loss impact

    With 5 Sentinels total and 2 disconnected, 3 remain connected and can form quorum.
  3. Step 3: Determine failover possibility

    Since 3 Sentinels can still communicate, failover can proceed if they agree.
  4. Final Answer:

    Failover can still occur if the remaining 3 Sentinels agree. -> Option B
  5. Quick Check:

    Quorum met by connected Sentinels [OK]
Hint: Failover needs quorum Sentinels connected [OK]
Common Mistakes:
  • Assuming failover impossible if any Sentinels disconnect
  • Thinking quorum auto-adjusts
  • Believing Redis master shuts down automatically
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard