Bird
Raised Fist0
Redisquery~20 mins

Monitoring with Sentinel in Redis - Practice Problems & Coding Challenges

Choose your learning style10 modes available
Challenge - 5 Problems
🎖️
Sentinel Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate
1:30remaining
Sentinel Master Discovery Output
You run the command SENTINEL get-master-addr-by-name mymaster on a Redis Sentinel instance monitoring a master named mymaster. What is the expected output format?
AAn array with two elements: the IP address and the port of the current master
BA string with the master name only
CAn integer representing the number of connected slaves
DA boolean indicating if the master is reachable
Attempts:
2 left
💡 Hint
Think about what information Sentinel needs to provide to clients about the master.
🧠 Conceptual
intermediate
1:30remaining
Sentinel Quorum Role
What is the role of the quorum setting in Redis Sentinel configuration?
AIt sets the maximum number of slaves allowed per master
BIt controls the frequency of Sentinel health checks
CIt specifies the timeout for client connections to the master
DIt defines the minimum number of Sentinels that must agree a master is down before failover
Attempts:
2 left
💡 Hint
Quorum is about agreement among Sentinels.
❓ Troubleshoot
advanced
2:00remaining
Sentinel Failover Not Triggering
You notice that your Redis Sentinel setup is not triggering failover even though the master is down. Which configuration mistake could cause this?
AThe master node has more than 5 connected slaves
BThe quorum value is set higher than the number of running Sentinel instances
CThe Sentinel port is set to the same port as the Redis master
DThe client timeout is set to 1000 milliseconds
Attempts:
2 left
💡 Hint
Failover depends on enough Sentinels agreeing the master is down.
🔀 Workflow
advanced
2:30remaining
Sentinel Automatic Failover Steps
Put the following Redis Sentinel failover steps in the correct order.
A1,3,2,4
B2,1,3,4
C1,2,3,4
D3,1,2,4
Attempts:
2 left
💡 Hint
Think about detection, agreement, promotion, then update.
✅ Best Practice
expert
3:00remaining
Sentinel Deployment Best Practice
Which is the best practice for deploying Redis Sentinel instances to ensure high availability and avoid split-brain scenarios?
ADeploy an odd number of Sentinel instances on separate physical or virtual machines across different failure domains.
BDeploy all Sentinel instances on the same machine as the Redis master for faster communication.
CDeploy Sentinel instances only on slave nodes to reduce load on the master.
DDeploy a single Sentinel instance with a very low quorum value to speed up failover.
Attempts:
2 left
💡 Hint
Think about avoiding single points of failure and ensuring consensus.

Practice

(1/5)
1. What is the main purpose of Redis Sentinel in monitoring?
easy
A. To provide a graphical user interface for Redis
B. To automatically detect Redis server failures and promote replicas
C. To increase Redis memory capacity
D. To store data persistently on disk

Solution

  1. Step 1: Understand Sentinel's role

    Sentinel monitors Redis servers to detect failures automatically.
  2. Step 2: Identify Sentinel's key feature

    It can promote replicas to master to keep Redis available during failures.
  3. Final Answer:

    To automatically detect Redis server failures and promote replicas -> Option B
  4. Quick Check:

    Sentinel monitors and promotes replicas [OK]
Hint: Sentinel watches and promotes Redis servers automatically [OK]
Common Mistakes:
  • Confusing Sentinel with data storage
  • Thinking Sentinel increases memory
  • Assuming Sentinel provides GUI
2. Which command correctly tells Sentinel to monitor a Redis master named mymaster at IP 192.168.1.10 on port 6379 with quorum 2?
easy
A. sentinel monitor mymaster 192.168.1.10 6379
B. sentinel watch mymaster 192.168.1.10 6379 2
C. sentinel add mymaster 192.168.1.10 6379 2
D. sentinel monitor mymaster 192.168.1.10 6379 2

Solution

  1. Step 1: Recall Sentinel monitor syntax

    The correct syntax is: sentinel monitor <name> <ip> <port> <quorum>.
  2. Step 2: Match the command to syntax

    sentinel monitor mymaster 192.168.1.10 6379 2 matches the syntax exactly with all required parameters.
  3. Final Answer:

    sentinel monitor mymaster 192.168.1.10 6379 2 -> Option D
  4. Quick Check:

    Correct sentinel monitor syntax [OK]
Hint: Use 'sentinel monitor' with name, IP, port, quorum [OK]
Common Mistakes:
  • Using 'sentinel watch' instead of 'monitor'
  • Omitting quorum number
  • Using 'sentinel add' which is invalid
3. Given the following Sentinel configuration snippet:
sentinel monitor mymaster 10.0.0.5 6379 2
sentinel down-after-milliseconds mymaster 5000
sentinel failover-timeout mymaster 10000

What does the down-after-milliseconds setting control?
medium
A. Time Redis waits before shutting down
B. Time replicas wait before syncing
C. Time Sentinel waits before marking master as down
D. Time Sentinel waits before starting failover

Solution

  1. Step 1: Understand 'down-after-milliseconds'

    This setting defines how long Sentinel waits to consider the master as unreachable.
  2. Step 2: Match setting to behavior

    It controls the time Sentinel waits before marking the master as down.
  3. Final Answer:

    Time Sentinel waits before marking master as down -> Option C
  4. Quick Check:

    down-after-milliseconds = time to mark down [OK]
Hint: down-after-milliseconds sets master down detection time [OK]
Common Mistakes:
  • Confusing with Redis shutdown time
  • Thinking it controls replica sync delay
  • Assuming it delays failover start
4. You configured Sentinel with:
sentinel monitor mymaster 10.0.0.5 6379 2

But Sentinel never triggers failover even when the master is down. What is a likely cause?
medium
A. Quorum is set too high for available Sentinels
B. Master IP address is incorrect
C. Sentinel service is not running
D. Redis master port is blocked by firewall

Solution

  1. Step 1: Understand quorum role

    Quorum is the number of Sentinels that must agree master is down to trigger failover.
  2. Step 2: Analyze failover condition

    If quorum is higher than available Sentinels, failover never triggers.
  3. Final Answer:

    Quorum is set too high for available Sentinels -> Option A
  4. Quick Check:

    Failover needs quorum Sentinels agreeing [OK]
Hint: Check quorum matches number of running Sentinels [OK]
Common Mistakes:
  • Ignoring quorum size
  • Assuming IP or port issues cause failover block
  • Not verifying Sentinel service status
5. You have 3 Sentinel instances monitoring a Redis master with quorum 2. One Sentinel detects the master is down and starts failover, but the other two Sentinels disagree. What will happen?
hard
A. Failover will not proceed until at least 2 Sentinels agree
B. Failover proceeds immediately with one Sentinel's decision
C. Sentinel with disagreement will restart Redis master
D. All Sentinels shut down to avoid split-brain

Solution

  1. Step 1: Understand quorum in failover

    Failover requires quorum number of Sentinels to agree master is down.
  2. Step 2: Analyze scenario with 3 Sentinels and quorum 2

    Only one Sentinel detects down, so quorum not reached; failover waits.
  3. Final Answer:

    Failover will not proceed until at least 2 Sentinels agree -> Option A
  4. Quick Check:

    Failover needs quorum agreement [OK]
Hint: Failover needs quorum agreement, not just one Sentinel [OK]
Common Mistakes:
  • Thinking one Sentinel can trigger failover alone
  • Assuming Sentinels restart Redis master
  • Believing Sentinels shut down on disagreement
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