1. The Redis recovery mechanism
- If only AOF is configured, the AOF file recovery data is loaded when the reboot is restarted;
- If both RDB and AOF are configured, the boot is only loaded with AOF file recovery data;
- If only the RDB is configured, startup is the load dump file to recover the data.
2. Recovering data from AoF
1 Note the following configuration
yesdir /home/redis/data_6379/
2 Copy the AOF file to the Redis data Catalog
cp appendonly.aof /home/redis/data_6379/
3 Start Redis-server
redis-server redis_6379.conf
3. Recovering data from an RDB file
1 Note the following configuration
nodir /home/redis/data_6379/
2 Copying an RDB file to a Redis data Catalog
cp dump.db /home/redis/data_6379/
3 Start Redis-server
redis-server redis_6379.conf
Use the Redis-port tool to synchronize a self-built Redis Rdb file to a cloud database download Redis-port
Redis-port Address
Using the example
- ./redis-port Restore--input=x/Dump.Rdb--Target=Dst_host:Dst_port--Auth=Dst_password[--Filterkey= "STR1|STR2|STR3" ][--targetdb=db] [--] [--bigkeysize=size [-- Logfile=redisport.
Parameter description
-
x/dump.rdb : Dump file path for self-built Redis
-
dst_host: redis domain name for cloud database
-
dst_port : Redis Port for Cloud databases
-
dst_password: redis password for cloud database
-
STR1|STR2|STR3: Filter for keys with str1 or str2 or STR3
-
DB: DB that will synchronize the cloud database Redis
-
Rewrite: Overwrite the key already written
-
Bigkeysize=size: When the value written is greater than SIZE, go to large key write mode
View data synchronization status based on Redis-port log
restore: rdb donedata synchronization is complete when it appears.
Reference article: https://help.aliyun.com/document_detail/66008.html
Redis data recovery method, Redis-port tool synchronizes a self-built Redis Rdb file to a cloud database