Redis的AOF持久化-Redis学习笔记四
2016-04-26 23:37
447 查看
1.append only file (AOF持久化)
本质:把用户执行的每个“写”指令(添加、修改、删除)都备份到文件中,还原数据的时候就是执行具体写指令而已。
开启AOF持久化(会清空redis内部的数据):
(同时可以修改备份文件的名字,默认是appendonly.aof)
配置文件被修改,需要删除旧进程,再根据新的配置文件启动新进程:
新进程启动好后会看到对应的aof持久化备份文件appendonly.aof:
aof追加持久化的备份频率:
2. 为aof备份文件做优化处理
对appendonly.aof文件内容做优化压缩处理:
(例如多个incr指令变为一个set指令)
bgrewriteaof 当日志文件过长时优化AOF日志文件存储
本质:把用户执行的每个“写”指令(添加、修改、删除)都备份到文件中,还原数据的时候就是执行具体写指令而已。
开启AOF持久化(会清空redis内部的数据):
(同时可以修改备份文件的名字,默认是appendonly.aof)
# AOF and RDB persistence can be enabled at the same time without problems. # If the AOF is enabled on startup Redis will load the AOF, that is the file # with the better durability guarantees. # # Please check http://redis.io/topics/persistence for more information. appendonly yes
配置文件被修改,需要删除旧进程,再根据新的配置文件启动新进程:
新进程启动好后会看到对应的aof持久化备份文件appendonly.aof:
aof追加持久化的备份频率:
# More details please check the following article: # http://antirez.com/post/redis-persistence-demystified.html # # If unsure, use "everysec". # appendfsync always appendfsync everysec # appendfsync no
2. 为aof备份文件做优化处理
对appendonly.aof文件内容做优化压缩处理:
(例如多个incr指令变为一个set指令)
bgrewriteaof 当日志文件过长时优化AOF日志文件存储
相关文章推荐
- 打开redis服务提示
- Redis Output-Buffer-Limits
- spring+redis做数据缓存
- Linux is not Matrix——redis集群搭建
- Spring Boot使用redis做数据缓存
- Redis+Spring缓存实例
- redis 性能优化
- redis配置密码认证
- Nopcommerce 3.7 增加了Redis 作为缓存啦
- java之redis篇(spring-data-redis整合)(很好)
- Redis Cluster
- redis.conf的配置解析
- redis 3.0安装报错处理
- redis配置文件redis-conf
- redis常用内存优化手段与参数
- redis配置文件redis-common.conf
- Redis配置集群遇到问题及解决方法
- redis集群搭建手册
- redis-list
- Redis(2.6版本以上) String 常用操作和方法详解