Complete the code to set up a Redis replica.
replicaof [1] 6379
The replicaof command tells Redis to replicate data from the master at the given IP address. Using 127.0.0.1 means the replica connects to the master on the same machine.
Complete the command to check the role of a Redis instance.
info replication | grep [1]The info replication command shows replication info. Filtering by role shows if the instance is a master or replica.
Fix the error in the command to promote a replica to master.
redis-cli [1]The correct command to promote a replica to master is replicaof no one with spaces.
Fill both blanks to complete the Redis configuration for replication.
replicaof [1] [2]
The replicaof command requires the master's IP and port. Here, 192.168.0.10 is the master IP and 6379 is the default Redis port.
Fill all three blanks to create a Redis command that sets a key with replication enabled.
redis-cli -h [1] -p [2] set [3] "value"
This command connects to Redis at localhost on port 6379 and sets the key mykey with the value "value". Replication will propagate this change to replicas.