0
0
Redisquery~10 mins

Why clustering provides horizontal scaling in Redis - Test Your Understanding

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to add a node to a Redis cluster.

Redis
redis-cli --cluster add-node [1] 127.0.0.1:7000
Drag options to blanks, or click blank then click option'
A127.0.0.1:7002
B127.0.0.1:7001
C127.0.0.1:7004
D127.0.0.1:7003
Attempts:
3 left
💡 Hint
Common Mistakes
Using the existing cluster node address instead of the new node address.
Confusing the order of IP addresses.
2fill in blank
medium

Complete the code to create a Redis cluster with 3 nodes.

Redis
redis-cli --cluster create 127.0.0.1:7000 [1] 127.0.0.1:7002 --cluster-replicas 0
Drag options to blanks, or click blank then click option'
A127.0.0.1:7001
B127.0.0.1:7003
C127.0.0.1:7004
D127.0.0.1:7005
Attempts:
3 left
💡 Hint
Common Mistakes
Using a node address outside the intended cluster range.
Skipping a node address.
3fill in blank
hard

Fix the error in the command to reshard slots in a Redis cluster.

Redis
redis-cli --cluster reshard [1] --cluster-from 0 --cluster-to 1 --cluster-slots 5000
Drag options to blanks, or click blank then click option'
A127.0.0.1:7002
B127.0.0.1:7000
C127.0.0.1:7001
D127.0.0.1:7003
Attempts:
3 left
💡 Hint
Common Mistakes
Using an address not in the cluster.
Using a node that is down or unreachable.
4fill in blank
hard

Fill both blanks to assign hash slots evenly across 3 nodes in a Redis cluster.

Redis
redis-cli --cluster create 127.0.0.1:7000 [1] [2] --cluster-replicas 0
Drag options to blanks, or click blank then click option'
A127.0.0.1:7001
B127.0.0.1:7002
C127.0.0.1:7003
D127.0.0.1:7004
Attempts:
3 left
💡 Hint
Common Mistakes
Using non-consecutive or wrong node addresses.
Including nodes not intended for the cluster.
5fill in blank
hard

Fill all three blanks to create a dictionary of node IDs mapped to their IP addresses in Redis cluster info.

Redis
nodes = { [1]: '[2]', '[3]': '127.0.0.1:7001'}
Drag options to blanks, or click blank then click option'
A'node-1'
B127.0.0.1:7000
C'node-0'
D127.0.0.1:7002
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing keys and values or missing quotes.
Using IP addresses as keys without quotes.