Complete the code to add a node to a Redis cluster.
redis-cli --cluster add-node [1] 127.0.0.1:7000
The command adds the node at 127.0.0.1:7001 to the cluster with the existing node at 127.0.0.1:7000.
Complete the code to create a Redis cluster with 3 nodes.
redis-cli --cluster create 127.0.0.1:7000 [1] 127.0.0.1:7002 --cluster-replicas 0
The cluster is created with nodes 7000, 7001, and 7002.
Fix the error in the command to reshard slots in a Redis cluster.
redis-cli --cluster reshard [1] --cluster-from 0 --cluster-to 1 --cluster-slots 5000
The reshard command requires the address of the node to connect to, here 127.0.0.1:7001.
Fill both blanks to assign hash slots evenly across 3 nodes in a Redis cluster.
redis-cli --cluster create 127.0.0.1:7000 [1] [2] --cluster-replicas 0
The cluster is created with nodes 7000, 7001, and 7002 to distribute slots evenly.
Fill all three blanks to create a dictionary of node IDs mapped to their IP addresses in Redis cluster info.
nodes = { [1]: '[2]', '[3]': '127.0.0.1:7001'}This dictionary maps node IDs to their IP addresses for cluster management.