The redis service has a replication function. You can execute the SLAVEOF command or set the slaveof option to let one server replicate another server, commonly known as "master-slave synchronization" (the replication logic of redis version 2.8 and versions lower than 2.8 is different, so you need to Note), therefore, data migration is divided into the following steps:
The target server for migration is set as the slave server of the migrated server
After the slave catches up with the progress of the master, stop writing redis business (if shutdown is not possible, you need to consider redoing the pipeline during the migration, or perform the migration during the off-peak period of the business and accept the short-term data loss)
After the master-slave server is fully synchronized, modify and write the redis business configuration, point it to the slave server, and disconnect the master-slave relationship
Resume writing redis business
redis replication function customer reference: link description
In addition, the redis instance running on the external network must set up master-slave and turn on the persistence option (redis has two persistence strategies: RDB and AOF) to prevent single points of failure
1. Back up the current redis, there will be a dump.rdb file 2. Copy the file to the redis directory of another server 3. Restart redis and it will be OK
The redis service has a replication function. You can execute the SLAVEOF command or set the slaveof option to let one server replicate another server, commonly known as "master-slave synchronization" (the replication logic of redis version 2.8 and versions lower than 2.8 is different, so you need to Note), therefore, data migration is divided into the following steps:
redis replication function customer reference: link description
In addition, the redis instance running on the external network must set up master-slave and turn on the persistence option (redis has two persistence strategies: RDB and AOF) to prevent single points of failure
1. Back up the current redis, there will be a dump.rdb file
2. Copy the file to the redis directory of another server
3. Restart redis and it will be OK