Introduction
Replication copies data from one place to another. This helps keep data safe if one copy is lost or broken.
Replication copies data from one place to another. This helps keep data safe if one copy is lost or broken.
replicaof <master-ip> <master-port>
replicaof 192.168.1.100 6379
replicaof no one
This example shows setting a key on the master Redis server. Then the replica server is told to copy from the master. Finally, the replica can read the same key.
# On master server SET user:1 "Alice" # On replica server replicaof 127.0.0.1 6379 # After replication GET user:1
Replication helps keep data safe by having copies in different places.
If the master fails, replicas can be promoted to keep the system running.
Replication copies data to create backups automatically.
This makes your data safer and your app more reliable.
Replicas update continuously to match the master data.
user:1 set to "Alice", what will a replica show after replication?user:1 = "Alice", replica will have the same.user:1 = "Alice" -> Option APass the test and this pattern moves unknown