Redis的快照持久化-Redis学习笔记三
来源:互联网 发布:自学编程入门教程 编辑:程序博客网 时间:2024/06/02 06:46
Redis持久化功能
redis为了内部数据的安全考虑,会把本身的数据以文件形式保存到硬盘中一份,在服务器重启之后会自动把硬盘的数据恢复到内存(redis)的里边。
数据保存到硬盘的过程就称为“持久化”效果。
1. snap shotting快照持久化
该持久化默认开启,一次性把redis中全部的数据保存一份存储在硬盘中,如果数据非常多(10-20G)就不适合频繁进行该持久化操作。
下方是快照持久化在本地硬盘保留的数据备份文件(redis自动生成):
查看快照持久化的备份频率(打开redis.conf):
################################ 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 at all commenting all the "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 1save 300 10save 60 10000
save 900 1 #900 秒内如果超过 1 个 key 被修改,则发起快照保存
save 300 10 #300秒超过10个key被修改,发起快照
save 60 10000 #60秒超过10000个key被修改,发起快照
以上三个save的理解:
数据修改的频率非常高,备份的频率也高
数据修改的频率低,备份的频率也低
查看快照持久化文件的名字和存储位置(打开redis.conf):
# The filename where to dump the DBdbfilename dump.rdb# The working directory.## The DB will be written inside this directory, with the filename specified# above using the 'dbfilename' configuration directive.# # The Append Only File will also be created inside this directory.# # Note that you must specify a directory here, not a file name.dir ./
快照持久化 和 精细持久化 可以尽最大程度保证数据的安全:
2、手动发起快照持久化
手动发起快照持久化
1 0
- Redis的快照持久化-Redis学习笔记三
- Redis快照持久化
- redis的rdb快照持久化
- Redis rdb快照持久化
- [Redis]Redis持久化之RDB快照
- redis学习三 ------ redis持久化
- redis的持久化--快照持久化(SNAPSHOTTING)
- Redis学习笔记9--Redis持久化
- Redis学习笔记9--Redis持久化
- Redis学习笔记(二) Redis持久化
- Redis学习笔记9--Redis持久化
- Redis学习笔记9--Redis持久化
- Redis学习笔记--Redis持久化
- Redis的AOF持久化-Redis学习笔记四
- Redis学习笔记四:redis的持久化
- Redis学习笔记四:redis的持久化
- redis学习笔记[3] redis的特性和持久化
- Redis 快照持久化学习笔记
- poj2955Brackets区间dp(括号匹配)
- 【南理工oj】116 - 士兵杀敌(二)(线段数 & 树状数组)
- HBase数据模型解析和基本的表设计分析
- Java的子类和父类实例化顺序
- Codeforces 669D 模拟
- Redis的快照持久化-Redis学习笔记三
- 错排公式
- caffe_layer
- n皇后问题 HDOJ-2553
- I00002 打印九九乘法表
- Linux 大于2T 解决方法
- 第三章 表,栈和队列
- HDOJ1106
- CentOS 6.5环境使用ansible剧本自动化部署Corosync + pacemaker环境及corosync常用配置详解