Multiple Sentinel instances help keep your Redis system safe and working well by watching over your Redis servers together.
Multiple Sentinel instances in Redis
sentinel monitor <master-name> <ip> <port> <quorum>
master-name is the name you give to your main Redis server.
quorum is how many Sentinels must agree before taking action.
sentinel monitor mymaster 127.0.0.1 6379 2
sentinel monitor mymaster 192.168.1.10 6379 3
This example shows three Sentinel instances all set to watch the same Redis master named 'mymaster' on localhost port 6379. They require at least 2 Sentinels to agree before failover.
# Start three Sentinel instances monitoring the same master sentinel monitor mymaster 127.0.0.1 6379 2 sentinel monitor mymaster 127.0.0.1 6380 2 sentinel monitor mymaster 127.0.0.1 6381 2
Run multiple Sentinel instances on different servers or ports to avoid a single point of failure.
All Sentinels must have the same configuration for the master they monitor.
The quorum number should be less than or equal to the number of Sentinel instances running.
Multiple Sentinel instances work together to keep Redis safe and available.
They watch the same Redis master and agree before switching to a backup.
Use a quorum to decide how many Sentinels must agree to act.
Practice
What is the main role of multiple Redis Sentinel instances working together?
Solution
Step 1: Understand Sentinel's purpose
Redis Sentinel instances monitor the health of Redis masters and replicas.Step 2: Role of multiple Sentinels
Multiple Sentinels work together to agree on failover decisions to keep Redis available.Final Answer:
They monitor the Redis master and agree before failover. -> Option AQuick Check:
Sentinel consensus = monitor and agree [OK]
- Thinking Sentinels store data backups
- Confusing Sentinels with Redis memory management
- Believing Sentinels replace Redis entirely
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 2What does the last number 2 represent?
Solution
Step 1: Analyze the sentinel monitor command
The command format is sentinel monitor <name> <ip> <port> <quorum>.Step 2: Understand the quorum parameter
The last number specifies how many Sentinels must agree to start failover.Final Answer:
The number of Sentinels required to agree for failover. -> Option AQuick Check:
Quorum = number of Sentinels to agree [OK]
- Confusing quorum with port number
- Thinking it sets replica count
- Assuming it is a timeout value
Given three Sentinel instances monitoring a Redis master with quorum set to 2, what happens if only one Sentinel detects the master is down?
Solution
Step 1: Understand quorum in failover
Quorum defines how many Sentinels must agree the master is down before failover.Step 2: Apply quorum to scenario
With quorum 2, one Sentinel alone cannot trigger failover.Final Answer:
No failover will occur until at least two Sentinels agree. -> Option DQuick Check:
Failover needs quorum agreement [OK]
- Assuming one Sentinel can trigger failover
- Thinking Sentinels restart automatically
- Believing master is removed without quorum
Identify the error in this Sentinel configuration snippet:
sentinel monitor mymaster 192.168.1.10 6379 0What is wrong with the quorum value?
Solution
Step 1: Check quorum parameter rules
Quorum must be a positive integer, at least 1, to allow failover decisions.Step 2: Analyze given value
Quorum is set to 0, which is invalid and disables failover agreement.Final Answer:
Quorum cannot be zero; it must be at least 1. -> Option CQuick Check:
Quorum ≥ 1 for valid failover [OK]
- Setting quorum to zero
- Confusing IP validity with quorum
- Thinking port 6379 is invalid
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?
Solution
Step 1: Understand quorum and Sentinel count
Quorum is 3, meaning at least 3 Sentinels must agree to failover.Step 2: Analyze network loss impact
With 5 Sentinels total and 2 disconnected, 3 remain connected and can form quorum.Step 3: Determine failover possibility
Since 3 Sentinels can still communicate, failover can proceed if they agree.Final Answer:
Failover can still occur if the remaining 3 Sentinels agree. -> Option BQuick Check:
Quorum met by connected Sentinels [OK]
- Assuming failover impossible if any Sentinels disconnect
- Thinking quorum auto-adjusts
- Believing Redis master shuts down automatically
Ready to prove it?
Pass the test and this pattern moves unknown
