Redis's MS Master-slave cluster role: 1, master-slave backup to prevent downtime 2, read and write separation, share the Master Task 3, task separation
The MS Synchronization principle of Redis: Ms Automatic connection, s initiates synchronization, m start dump out Rdb,s received M's RDB storage to their own memory, in M dump process, and new data generated, m will buffer the new data into the AOF, when m do dump end, Also send aof to slave, complete a synchronization end.
650) this.width=650; "Src=" Http://s5.51cto.com/wyfs02/M02/8C/0A/wKiom1hftK-ijOa_AAA_oEnglE8364.png-wh_500x0-wm_3 -wmp_4-s_3812300390.png "title=" 11111.png "alt=" Wkiom1hftk-ijoa_aaa_oengle8364.png-wh_50 "/>
There are 2 ways to persist Redis : RDB, AOF
configuration options for Rdb snapshots
Save 1//within the range of 1 writes , a snapshot is generated
Save +// if there are more than five writes in a second, a snapshot is generated
Save 10000// if There are 10000 writes in a second , a snapshot is generated
( these 3 options are masked , the rdb is disabled )
Stop-writes-on-bgsave-error Yes// background backup process error , does the main process stop writing ?
Rdbcompression Yes// the exported rdb file is compressed
Rdbchecksum Yes// import RBD when restoring data , do not verify the integrity of the RDB
Dbfilename Dump.rdb//The RDB filename of the guide
Dir.///rdb Placement Path
configuration of the Aof
AppendOnly No # whether to turn on the aof log feature
Appendfsync always # every 1 commands , sync to aof immediately . safe , slow speed
Appendfsync everysec # Compromise, write 1 times per second
Appendfsync No # writes to the operating system , determines the buffer size by the operating system , and writes uniformly to the aof. low synchronization frequency , fast speed ,
No-appendfsync-on-rewrite Yes: # in the process of exporting an Rdb snapshot, either stop synchronizing aof
Auto-aof-rewrite-percentage #aof File size compared to the size of the last rewrite , the growth rate 100% when overridden
Auto-aof-rewrite-min-size 64mb #aof file , at least 64M , override
This article is from the "DBSpace" blog, so be sure to keep this source http://dbspace.blog.51cto.com/6873717/1885997
The basic configuration of Redis