Redis completes data migration through master-slave replication
Enter the new server and perform the slave configuration,
slaveofCommand to configure the current redis host,
infoCommand to view redis information. End of execution
slaveofExecute after command
master_link_statusIf the value of is
upIndicates that synchronization is complete. At this time, the role of redis is slave.
Execute after synchronization
slaveof no oneDisconnect the master and slave, and the redis role becomes the master.
$ redis-cli 127.0.0.1:6379 > slave of host IP host port 127.0.0.1:6379> info 127.0.0.1:6379> slaveof no one