How does Redis restore the Rdb file and the aof file to the database

Source: Internet
Author: User
Tags download redis redis

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
  1. ./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

 

How does Redis restore the Rdb file and the aof file to the database

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.