首页 > 其他 > 详细

Redis持久化策略

时间:2020-09-14 14:01:43      阅读:63      评论:0      收藏:0      [点我收藏+]

1、RDB:快照

  • 时间点问题:比如 8:00开始快照,8:10分才快照成功,那么快照的是8:00还是8:10分的数据
  • 方式:
    • save    【命令】  
    • bgsave 【命令】- fork[linux]另起一个子进程,数据隔离(写时复制)进行数据快照
    • 技术分享图片 
    • save <seconds> <changes> 【配置-注意:这边实际上调用的是bgsave命令】

      参考配置文件中的说明:大概指的是指定时间内至少有多少个数据改变

      

################################ SNAPSHOTTING  ################################
#
# Save the DB on disk:
#
#   save <seconds> <changes>
#
#   Will save the DB if both the given number of seconds and the given
#   number of write operations against the DB occurred.
#
#   In the example below the behaviour will be to save:
#   after 900 sec (15 min) if at least 1 key changed
#   after 300 sec (5 min) if at least 10 keys changed
#   after 60 sec if at least 10000 keys changed
#
#   Note: you can disable saving completely by commenting out all "save" lines.
#
#   It is also possible to remove all the previously configured save
#   points by adding a save directive with a single empty string argument
#   like in the following example:
#
#   save ""

save 900 1
save 300 10
save 60 10000

 

 

ps:涉及点-父子进程之间,数据隔离&CopyOnWrite(仅写时复制)

 

 

 

   

2、AOF:日志

Redis持久化策略

原文:https://www.cnblogs.com/gabin/p/13666134.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!