Redis---永続化

888 ワード

 :Redis         :
		1. Snapshotting(  )   ---     
			a.     
				save 900 1        #  900        1   key    ,       
				save 300 10     #  300        10   key    ,       
				save 60 10000
				
		2. Append-only file(   aof)
			•                    ,    redis  down ,                。              ,    AOF  。
			•   AOF      ,Redis              write        (  appendonly.aof), redis                          。    os       write    ,             ,              。            redis  fsync    os       ,       (    fsync  )
				appendonly yes                    //   aof       
				# appendfsync always      //            ,  ,           
				appendfsync everysec      //         ,                
				 # appendfsync no             //     os,    ,      
			•      aof       。redis      bgrewriteaof   。      redis                                  ,         。