Bird
Raised Fist0
Redisquery~20 mins

Failover manual process in Redis - Practice Problems & Coding Challenges

Choose your learning style10 modes available
Challenge - 5 Problems
🎖️
Redis Failover Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Understanding Redis manual failover steps

Which of the following sequences correctly describes the manual failover process in Redis Sentinel?

APromote the slave to master, update clients, and then notify Sentinel.
BPromote the slave to master, notify Sentinel, then update clients.
CNotify Sentinel, promote the slave to master, then update clients.
DUpdate clients, notify Sentinel, then promote the slave to master.
Attempts:
2 left
💡 Hint

Think about the order: first change the role, then inform the system, then clients.

❓ query_result
intermediate
1:30remaining
Result of manual failover command in Redis CLI

What is the expected output after running SLAVEOF NO ONE on a Redis slave during manual failover?

Redis
SLAVEOF NO ONE
A+OK
B-ERR unknown command 'SLAVEOF NO ONE'
C+FAILOVER_STARTED
D-ERR wrong number of arguments for 'SLAVEOF' command
Attempts:
2 left
💡 Hint

Consider the standard Redis response for successful commands.

📝 Syntax
advanced
1:30remaining
Identify the correct Redis CLI command for manual failover

Which of the following Redis CLI commands correctly initiates manual failover by promoting a slave to master?

ASLAVEOF NO ONE
BFAILOVER PROMOTE
CMASTER PROMOTE
DSENTINEL FAILOVER
Attempts:
2 left
💡 Hint

Remember the exact Redis command to stop replication and become master.

🔧 Debug
advanced
2:00remaining
Troubleshooting manual failover: why clients still connect to old master?

After manually promoting a slave to master, clients still connect to the old master. What is the most likely cause?

ASentinel automatically reverted the failover to the old master.
BThe slave was not promoted correctly with <code>SLAVEOF NO ONE</code>.
CClients have not updated their configuration to point to the new master.
DThe old master is still replicating data to the new master.
Attempts:
2 left
💡 Hint

Think about what clients need to do after failover.

❓ optimization
expert
3:00remaining
Optimizing manual failover to minimize downtime

Which approach best minimizes downtime during a manual failover in Redis Sentinel?

ARestart all Redis instances to refresh connections before failover.
BDisable Sentinel during failover to prevent automatic interference.
CManually stop the old master, promote the slave, then update clients after failover completes.
DPre-configure clients with multiple master addresses and use Sentinel notifications to switch automatically.
Attempts:
2 left
💡 Hint

Consider how to automate client switching to reduce manual steps.

Practice

(1/5)
1. What is the main purpose of performing a manual failover in a Redis cluster?
easy
A. To upgrade Redis to a new version automatically
B. To delete all data from the Redis cluster
C. To switch the Redis master to a backup to keep the service running
D. To backup Redis data to an external storage

Solution

  1. Step 1: Understand failover purpose

    Failover is used to switch the master node to a backup node when the master fails or needs maintenance.
  2. Step 2: Identify the correct purpose

    The goal is to keep the Redis service running without interruption by promoting a backup to master.
  3. Final Answer:

    To switch the Redis master to a backup to keep the service running -> Option C
  4. Quick Check:

    Failover = switch master to backup [OK]
Hint: Failover means switching master to backup to avoid downtime [OK]
Common Mistakes:
  • Confusing failover with data backup
  • Thinking failover upgrades Redis automatically
  • Assuming failover deletes data
2. Which command syntax is correct to trigger a manual failover on a Redis cluster node?
easy
A. redis-cli --failover cluster
B. redis-cli failover --cluster
C. redis-cli cluster --failover node
D. redis-cli --cluster failover

Solution

  1. Step 1: Recall the correct command format

    The correct syntax to trigger manual failover is using the cluster option with failover and the node ID.
  2. Step 2: Match the syntax

    Only redis-cli --cluster failover <node-id> matches the official Redis command format.
  3. Final Answer:

    redis-cli --cluster failover <node-id> -> Option D
  4. Quick Check:

    Correct failover command = redis-cli --cluster failover [OK]
Hint: Failover command starts with 'redis-cli --cluster failover' [OK]
Common Mistakes:
  • Mixing order of command options
  • Using failover without --cluster
  • Incorrect placement of node-id
3. Given the command redis-cli --cluster failover 07c37dfeb2352e03a5a5a3b8f8f8f8f8f8f8f8f8 is executed, what is the expected result?
medium
A. The cluster will shut down immediately
B. The specified node is promoted to master if it is a replica
C. The command will return a syntax error
D. The node will be removed from the cluster

Solution

  1. Step 1: Understand the failover command effect

    The command triggers a manual failover on the specified node, promoting it to master if it is a replica.
  2. Step 2: Eliminate incorrect outcomes

    The cluster does not shut down, no syntax error occurs, and the node is not removed by this command.
  3. Final Answer:

    The specified node is promoted to master if it is a replica -> Option B
  4. Quick Check:

    Failover promotes replica to master [OK]
Hint: Failover promotes replica node to master, no shutdown [OK]
Common Mistakes:
  • Thinking failover shuts down cluster
  • Expecting syntax error on correct command
  • Assuming node removal happens
4. You run redis-cli --cluster failover without specifying a node ID. What is the likely outcome?
medium
A. The command returns an error about missing node ID
B. Manual failover is triggered on all nodes
C. The cluster automatically selects a node for failover
D. The command silently does nothing

Solution

  1. Step 1: Check command requirements

    The failover command requires a node ID to specify which node to promote.
  2. Step 2: Predict command behavior without node ID

    Without the node ID, the command will return an error indicating the missing argument.
  3. Final Answer:

    The command returns an error about missing node ID -> Option A
  4. Quick Check:

    Missing node ID causes error [OK]
Hint: Failover needs node ID; missing it causes error [OK]
Common Mistakes:
  • Assuming failover runs on all nodes
  • Expecting automatic node selection
  • Thinking command does nothing silently
5. After triggering a manual failover with redis-cli --cluster failover <node-id>, what is the best practice to ensure the cluster is stable?
hard
A. Confirm the new master node is ready to serve data
B. Immediately restart all cluster nodes
C. Delete the old master node from the cluster
D. Run a full data backup before any verification

Solution

  1. Step 1: Understand post-failover steps

    After failover, the new master must be confirmed to be ready to serve data to avoid downtime or data loss.
  2. Step 2: Evaluate other options

    Restarting all nodes or deleting old master is unnecessary and risky; backup is good but not immediate priority.
  3. Final Answer:

    Confirm the new master node is ready to serve data -> Option A
  4. Quick Check:

    Verify new master readiness after failover [OK]
Hint: Always check new master readiness after failover [OK]
Common Mistakes:
  • Restarting cluster unnecessarily
  • Deleting old master prematurely
  • Ignoring verification step
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