0
0
Redisquery~20 mins

Adding and removing nodes in Redis - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Redis Cluster Node Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
query_result
intermediate
2:00remaining
What is the output of adding a new node to a Redis cluster?
You have a Redis cluster with 3 nodes. You run the command to add a new node to the cluster. What will the cluster nodes list show after adding the new node but before resharding?
Redis
redis-cli --cluster add-node 192.168.1.4:7004 192.168.1.1:7000
redis-cli --cluster nodes 192.168.1.1:7000
AThe new node appears in the cluster nodes list with no slots assigned.
BThe new node appears with all slots assigned to it.
CThe new node does not appear until resharding is done.
DThe cluster nodes list shows an error because slots are not balanced.
Attempts:
2 left
💡 Hint
Think about what happens immediately after adding a node before moving slots.
query_result
intermediate
2:00remaining
What happens when you remove a node that holds slots without resharding?
In a Redis cluster, you remove a node that currently holds hash slots without migrating its slots first. What will be the state of the cluster?
Redis
redis-cli --cluster del-node 192.168.1.2:7002 <node-id>
AThe node is removed and slots are lost but cluster continues normally.
BThe cluster automatically migrates slots to other nodes.
CThe cluster enters an error state and refuses writes to affected slots.
DThe command fails because slots must be migrated before removal.
Attempts:
2 left
💡 Hint
Consider what happens to data when slots are suddenly missing.
📝 Syntax
advanced
2:00remaining
Which command correctly adds a node to a Redis cluster?
You want to add a new node at IP 10.0.0.5 port 7005 to an existing cluster with a node at 10.0.0.1 port 7000. Which command is syntactically correct?
Aredis-cli --cluster add-node 10.0.0.5:7005 10.0.0.1:7000
Bredis-cli --cluster add-node 10.0.0.1:7000 10.0.0.5:7005
Credis-cli --cluster add-node --node 10.0.0.5:7005 --cluster 10.0.0.1:7000
Dredis-cli --add-node 10.0.0.5:7005 10.0.0.1:7000
Attempts:
2 left
💡 Hint
The syntax is: redis-cli --cluster add-node
optimization
advanced
2:00remaining
Best practice to minimize downtime when removing a Redis cluster node
You want to remove a node from a Redis cluster with minimal downtime. Which approach is best?
ARemove the node and rely on cluster auto-recovery to fix slots.
BMigrate slots from the node to be removed to other nodes, then remove the node.
CRemove the node immediately and then reshard slots manually.
DStop the entire cluster, remove the node, then restart the cluster.
Attempts:
2 left
💡 Hint
Think about how to keep data available during node removal.
🧠 Conceptual
expert
2:00remaining
Why is it important to reshard slots after adding a new node to a Redis cluster?
After adding a new node to a Redis cluster, why must you reshard slots to the new node?
ATo update the cluster configuration file automatically.
BBecause Redis requires manual slot assignment for security reasons.
CBecause the new node cannot join the cluster without slots.
DTo balance the data load and improve cluster performance.
Attempts:
2 left
💡 Hint
Think about what happens if slots are unevenly distributed.