Redis Persistent Configuration

Source: Internet
Author: User

There are 2 ways to persist Redis 1 Snapshot 2 is log

1. Configuration options for RDB snapshots

 save 900  1  //  900, 1 writes, resulting in a snapshot  save  300  1000  //  save  60  10000  //  
is generated

(These 3 options are masked , then the RDB is disabled ) You can look upside down if you understand.

// when the background backup process fails, does the main process stop writing? // whether the exported Rdb file is compressed // to verify the integrity of the RDB when importing RBD recovery data // the Rdb file name that is being directed out // placement path for an RDB

2, the Aof configuration

AppendOnly No # Open the AoF log feature Appendfsync always # every 1 commands, sync to aof Safe, Slow Appendfsync everysec # Compromise, write 1 times per second Appendfsync No # write work to the operating system, determined by the operating system buffer size, unified write to AoF. Low synchronization frequency, fast speed,
no-appendfsync-on-Rewrite yes: # in the process of exporting an RDB snapshot, either stop synchronizing Aofauto #aof文件大小比起上次重写时的大小, growth rate 100%  , overriding auto-aof-rewrite-min-size 64MB #aof文件, at least 64M

3. Matters of attention

Note: In the dump RDB process , aof if the synchronization is stopped, will it be lost ?

A: No , all operations are cached in the memory queue , and after the dump is complete, the operation is Unified .


Note : What does aof rewrite mean ?

A: aof rewrite refers to the memory of the data , the inverse of the command , written to the . AoF log .

To resolve The problem that the AOF log is too large .


Q : If the rdb file, and the aof file are present , who will be the first to recover the data ?

Answer : aof


Q : Can 2 types be used at the same time ?

A: Yes , and recommend it.


Q : Which of the Rdb and AoF recovers quickly when recovering

A : The RDB is fast , because it is the memory map of the data , directly loaded into the memory , and aof is the command , need to be executed

Redis Persistent Configuration

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.