0
0
Redisquery~20 mins

Cluster creation in Redis - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Redis Cluster Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
1:30remaining
What is the main purpose of creating a Redis cluster?

Redis clusters are used to:

ADistribute data across multiple nodes for scalability and fault tolerance
BEncrypt data automatically without configuration
CStore data only on a single node for faster access
DBackup data to external storage automatically
Attempts:
2 left
💡 Hint

Think about why multiple Redis nodes work together in a cluster.

query_result
intermediate
1:30remaining
What is the output of the command CLUSTER INFO on a healthy Redis cluster?

Given a healthy Redis cluster, what does the CLUSTER INFO command return for the cluster_state field?

Redis
CLUSTER INFO
Acluster_state:fail
Bcluster_state:unknown
Ccluster_state:ok
Dcluster_state:down
Attempts:
2 left
💡 Hint

Healthy means the cluster is working fine.

📝 Syntax
advanced
2:00remaining
Which command correctly adds a node to an existing Redis cluster?

Select the correct Redis CLI command to add a new node with IP 192.168.1.10 and port 7003 to an existing cluster.

Aredis-cli --cluster create 192.168.1.10:7003 192.168.1.1:7000
Bredis-cli --cluster add-node 192.168.1.10:7003 192.168.1.1:7000
Credis-cli --cluster join 192.168.1.10:7003 192.168.1.1:7000
Dredis-cli --cluster attach 192.168.1.10:7003 192.168.1.1:7000
Attempts:
2 left
💡 Hint

Adding a node uses the add-node option.

optimization
advanced
2:00remaining
How can you optimize slot allocation when creating a Redis cluster with 3 nodes?

You want to create a Redis cluster with 3 nodes and distribute slots evenly. Which command option ensures balanced slot allocation?

Aredis-cli --cluster create 192.168.1.1:7000 192.168.1.2:7000 192.168.1.3:7000 --cluster-replicas 0
Bredis-cli --cluster create 192.168.1.1:7000 192.168.1.2:7000 192.168.1.3:7000 --cluster-assign-slots 0
Credis-cli --cluster create 192.168.1.1:7000 192.168.1.2:7000 192.168.1.3:7000 --cluster-replicas 1
Dredis-cli --cluster create 192.168.1.1:7000 192.168.1.2:7000 192.168.1.3:7000 --cluster-slots 16384
Attempts:
2 left
💡 Hint

Think about how replicas affect slot distribution.

🔧 Debug
expert
2:30remaining
Why does the command redis-cli --cluster create 192.168.1.1:7000 192.168.1.2:7000 fail?

You try to create a Redis cluster with only two nodes using the command above. Why does it fail?

ARedis cluster cannot be created on ports below 7000
BThe command syntax is incorrect; it needs a <code>--cluster-replicas</code> option
CThe IP addresses must be localhost for cluster creation
DRedis cluster requires at least 3 master nodes to form a valid cluster
Attempts:
2 left
💡 Hint

Think about the minimum number of master nodes for a Redis cluster.