1 AOF-----> AppendOnly Yes 2 cp appendonly.aof to Redis database directory that is the DIR keyword in config file 3 restart service
2 RDB-----> AppendOnly No 2 cp dump.rdb to Redis database directory that is the DIR keyword in config file 3 restart service
- 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 done
data synchronization is complete when it appears.
Reference article: https://help.aliyun.com/document_detail/66008.html
How does Redis restore the Rdb file and the aof file to the database