Bird
Raised Fist0
Redisquery~20 mins

Sentinel configuration 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!
❓ query_result
intermediate
2:00remaining
Sentinel monitoring configuration output
Given the following Redis Sentinel configuration snippet, what will be the output of the SENTINEL masters command?

sentinel monitor mymaster 192.168.1.100 6379 2
sentinel down-after-milliseconds mymaster 5000
sentinel failover-timeout mymaster 60000
sentinel parallel-syncs mymaster 1
A[]
B[{"name":"mymaster","ip":"127.0.0.1","port":6379,"quorum":2}]
C[{"name":"mymaster","ip":"192.168.1.100","port":6380,"quorum":2}]
D[{"name":"mymaster","ip":"192.168.1.100","port":6379,"quorum":2}]
Attempts:
2 left
💡 Hint
Check the IP and port values in the sentinel monitor command.
🧠 Conceptual
intermediate
1:30remaining
Understanding Sentinel quorum
In Redis Sentinel configuration, what does the quorum number specify?
AThe number of seconds before a master is considered down
BThe number of replicas to promote during failover
CThe number of Sentinels that must agree a master is down before failover starts
DThe number of clients allowed to connect to the master
Attempts:
2 left
💡 Hint
Think about how Sentinels decide to start failover.
📝 Syntax
advanced
1:30remaining
Identify the syntax error in Sentinel config
Which of the following Sentinel configuration lines contains a syntax error?
Asentinel monitor mymaster 192.168.1.100 6379 2
Bsentinel parallel-syncs mymaster
Csentinel failover-timeout mymaster 60000
Dsentinel down-after-milliseconds mymaster 5000
Attempts:
2 left
💡 Hint
Check if all required parameters are present.
❓ optimization
advanced
1:30remaining
Optimizing Sentinel failover timeout
You want to reduce the failover time in your Redis Sentinel setup. Which configuration change will most directly reduce the failover duration?
ADecrease the value of sentinel failover-timeout
BIncrease the value of sentinel down-after-milliseconds
CIncrease the quorum number
DDecrease the number of Sentinels monitoring the master
Attempts:
2 left
💡 Hint
Failover-timeout controls the maximum time for failover to complete.
🔧 Debug
expert
2:30remaining
Debugging Sentinel failover not triggering
You have 3 Sentinels monitoring a master with quorum set to 2. The master goes down, but failover does not start. Which is the most likely cause?
AOnly one Sentinel detected the master as down, so quorum was not reached
BThe failover-timeout is set too low
CThe master IP address is incorrect in the Sentinel config
DThe parallel-syncs value is set to zero
Attempts:
2 left
💡 Hint
Quorum requires multiple Sentinels to agree on master status.

Practice

(1/5)
1. What is the main purpose of Redis Sentinel in a Redis setup?
easy
A. To provide a graphical user interface for Redis
B. To store data persistently on disk
C. To monitor Redis servers and perform automatic failover if the master fails
D. To increase the speed of Redis queries

Solution

  1. Step 1: Understand Sentinel's role

    Redis Sentinel monitors Redis servers to detect failures.
  2. Step 2: Identify failover capability

    Sentinel automatically switches to a backup server if the master fails.
  3. Final Answer:

    To monitor Redis servers and perform automatic failover if the master fails -> Option C
  4. Quick Check:

    Sentinel = automatic failover [OK]
Hint: Sentinel watches and switches masters automatically [OK]
Common Mistakes:
  • Confusing Sentinel with data storage
  • Thinking Sentinel speeds up queries
  • Assuming Sentinel provides UI
2. Which of the following is the correct syntax to configure a Redis Sentinel to monitor a master named mymaster on IP 192.168.1.100 and port 6379?
easy
A. sentinel monitor mymaster 192.168.1.100 6379 2
B. monitor sentinel mymaster 192.168.1.100 6379 2
C. sentinel set mymaster 192.168.1.100 6379 2
D. sentinel watch mymaster 192.168.1.100 6379 2

Solution

  1. Step 1: Recall Sentinel monitor command format

    The correct command starts with sentinel monitor followed by master name, IP, port, and quorum.
  2. Step 2: Match the correct syntax

    sentinel monitor mymaster 192.168.1.100 6379 2 matches the correct order and keywords.
  3. Final Answer:

    sentinel monitor mymaster 192.168.1.100 6379 2 -> Option A
  4. Quick Check:

    sentinel monitor = correct syntax [OK]
Hint: Sentinel monitor command starts with 'sentinel monitor' [OK]
Common Mistakes:
  • Swapping 'monitor' and 'sentinel'
  • Using 'set' or 'watch' instead of 'monitor'
  • Incorrect order of parameters
3. Given the following Sentinel configuration snippet:
sentinel monitor mymaster 10.0.0.1 6379 2
sentinel down-after-milliseconds mymaster 5000
sentinel failover-timeout mymaster 60000

What does the down-after-milliseconds setting specify?
medium
A. The time Sentinel waits before declaring the master as down
B. The time Redis waits before accepting writes
C. The timeout for client connections to Redis
D. The time Sentinel waits before starting a failover

Solution

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

    This setting defines how long Sentinel waits to consider the master unreachable.
  2. Step 2: Differentiate from failover timeout

    Failover timeout is different; it controls failover duration, not detection.
  3. Final Answer:

    The time Sentinel waits before declaring the master as down -> Option A
  4. Quick Check:

    down-after-milliseconds = detection wait time [OK]
Hint: 'down-after-milliseconds' means detection delay [OK]
Common Mistakes:
  • Confusing with failover timeout
  • Thinking it affects client connections
  • Assuming it controls Redis write delay
4. You have this Sentinel configuration line:
sentinel monitor mymaster 10.0.0.1 6379

What is wrong with this configuration?
medium
A. IP address format is incorrect
B. Master name should be 'master' not 'mymaster'
C. Port number should be 6380 for Sentinel
D. Missing the quorum number at the end

Solution

  1. Step 1: Check required parameters for sentinel monitor

    The command requires master name, IP, port, and quorum number.
  2. Step 2: Identify missing quorum

    The quorum number (minimum votes to failover) is missing in the line.
  3. Final Answer:

    Missing the quorum number at the end -> Option D
  4. Quick Check:

    Quorum number required in sentinel monitor [OK]
Hint: Sentinel monitor needs quorum number last [OK]
Common Mistakes:
  • Ignoring quorum number
  • Changing port unnecessarily
  • Assuming master name must be 'master'
5. You want to configure Redis Sentinel to monitor a master and automatically failover if it is down. Which combination of settings is necessary to ensure Sentinel detects failure quickly and performs failover within 1 minute?
hard
A. Set down-after-milliseconds to 60000 only
B. Set down-after-milliseconds to 5000 and failover-timeout to 60000
C. Set failover-timeout to 5000 only
D. Set down-after-milliseconds to 60000 and failover-timeout to 5000

Solution

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

    This controls how fast Sentinel marks master as down; 5000 ms means 5 seconds.
  2. Step 2: Understand 'failover-timeout'

    This controls how long failover can take; 60000 ms means 60 seconds (1 minute).
  3. Step 3: Combine settings for quick detection and failover

    Setting down-after-milliseconds to 5000 and failover-timeout to 60000 ensures detection in 5 seconds and failover within 1 minute.
  4. Final Answer:

    Set down-after-milliseconds to 5000 and failover-timeout to 60000 -> Option B
  5. Quick Check:

    Fast detection + 1 min failover = Set down-after-milliseconds to 5000 and failover-timeout to 60000 [OK]
Hint: Fast detection needs low down-after; failover-timeout sets max failover time [OK]
Common Mistakes:
  • Swapping values of down-after and failover-timeout
  • Setting only one parameter
  • Using too high down-after-milliseconds
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