0
0
Redisquery~5 mins

REPLICAOF command in Redis - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What does the REPLICAOF command do in Redis?
It makes the current Redis server a replica of another Redis server by specifying the master server's IP and port.
Click to reveal answer
beginner
How do you stop a Redis server from being a replica using REPLICAOF?
Use REPLICAOF NO ONE to make the Redis server stop replicating and become a master again.
Click to reveal answer
beginner
Syntax of the REPLICAOF command?
REPLICAOF <masterip> <masterport>
or
REPLICAOF NO ONE
to stop replication.
Click to reveal answer
intermediate
What happens to the data on a Redis server when you run REPLICAOF <masterip> <masterport>?
The server clears its current data and starts syncing data from the specified master server.
Click to reveal answer
intermediate
Can a Redis server be a replica of multiple masters at the same time using REPLICAOF?
No, a Redis server can only replicate from one master at a time.
Click to reveal answer
What command makes a Redis server stop replicating and become a master again?
AMASTEROF NO ONE
BREPLICAOF 127.0.0.1 6379
CSLAVEOF NO ONE
DREPLICAOF NO ONE
What does the REPLICAOF command require as arguments?
ADatabase name and password
BReplica name and port
CMaster IP and port
DUser and password
If you run REPLICAOF 192.168.1.10 6379, what happens?
AThe server becomes a replica of the master at 192.168.1.10:6379
BThe server becomes a master
CThe server deletes all data permanently
DThe server restarts
Can a Redis server replicate from two masters at the same time?
AYes, up to two masters
BNo, only one master at a time
CYes, unlimited masters
DOnly if configured in cluster mode
Which Redis command was previously used instead of REPLICAOF?
ASLAVEOF
BMASTEROF
CFOLLOW
DSYNC
Explain how the REPLICAOF command is used to set up replication in Redis.
Think about how a server becomes a replica and how it can stop replicating.
You got /4 concepts.
    Describe what happens internally when a Redis server runs REPLICAOF <masterip> <masterport>.
    Consider the data and role changes on the server.
    You got /3 concepts.