0
0
Redisquery~30 mins

Failover manual process in Redis - Mini Project: Build & Apply

Choose your learning style9 modes available
Manual Failover Process in Redis
📖 Scenario: You are managing a Redis setup with one master and two replicas. Sometimes the master server can go down, and you need to manually promote a replica to become the new master to keep your application running smoothly.
🎯 Goal: Learn how to perform a manual failover in Redis by promoting a replica to master and reconfiguring other replicas to follow the new master.
📋 What You'll Learn
Create a list of Redis nodes with their roles and IP addresses
Define the current master node IP
Write commands to promote a replica to master manually
Update other replicas to follow the new master
💡 Why This Matters
🌍 Real World
In real Redis deployments, manual failover is sometimes necessary when automatic failover fails or is not configured. This project simulates the commands and steps needed to perform manual failover.
💼 Career
Understanding manual failover helps database administrators and DevOps engineers maintain high availability and reliability of Redis services in production environments.
Progress0 / 4 steps
1
Setup Redis nodes list
Create a list called redis_nodes containing dictionaries for three Redis nodes with these exact entries: {'ip': '192.168.1.10', 'role': 'master'}, {'ip': '192.168.1.11', 'role': 'replica'}, and {'ip': '192.168.1.12', 'role': 'replica'}.
Redis
Need a hint?

Use a Python list with dictionaries for each Redis node.

2
Define current master IP
Create a variable called current_master_ip and set it to the string '192.168.1.10' to represent the current master node IP.
Redis
Need a hint?

Assign the IP of the master node to current_master_ip.

3
Promote a replica to master
Write a command string called promote_command that uses the Redis CLI command redis-cli -h 192.168.1.11 SLAVEOF NO ONE to promote the replica at IP 192.168.1.11 to master.
Redis
Need a hint?

Use the exact Redis CLI command string to promote the replica.

4
Reconfigure other replicas to follow new master
Create a list called replica_follow_commands containing the Redis CLI commands to make the replica at IP 192.168.1.12 follow the new master at IP 192.168.1.11. The command should be redis-cli -h 192.168.1.12 SLAVEOF 192.168.1.11 6379.
Redis
Need a hint?

Put the exact command string inside a list called replica_follow_commands.