redis 之 AOF
2015-09-22 16:13
791 查看
AOF(append-only fashion)是redis持久化利器之一。通过写log的方式,以满足在需要的时候,重建数据的需求。
the AOF persistence logs every write operation received by the server, that will be played again at server startup, reconstructing the original dataset. Commands are logged using the same format as the Redis protocol itself, in an append-only fashion. Redis
is able to rewrite the log on background when it gets too big.
Redis写日志包括:
1. 根据用户的配置,以不同的粒度写AOF log
2. 在日志数据量达到一定量的时候,根据配置或外部发送的命令,重建AOF log
Aof相关配置(redis.conf):
appendonly yes
是否开启AOF持久化,yes开启,no不开启
appendfilename appendonly.aof
指定AOF日志文件名称,默认名称:appendonly.aof
appendfsync everysec
什么时候将数据写入disk,redis提供三种模式:
no : 不进行fsync,有OS决定数据刷盘的时间粒度, 性能高
always : 每次写操作都做fsync , 安全
everysec : 上一个fsync后至少1s, 折中
no-appendfsync-on-rewrite no
当Aof log进行重写时,是否写日志时fsync。如果系统遇到latency问题,建议设为yes(rewrite时不强制fsync)
auto-aof-rewrite-percentage 100
当Aof log增长超过指定比例时,重写log file, 设置为0表示不自动重写Aof log
auto-aof-rewrite-min-size 64mb
启动重写Aof log时,Aof log的最小大小
the AOF persistence logs every write operation received by the server, that will be played again at server startup, reconstructing the original dataset. Commands are logged using the same format as the Redis protocol itself, in an append-only fashion. Redis
is able to rewrite the log on background when it gets too big.
Redis写日志包括:
1. 根据用户的配置,以不同的粒度写AOF log
2. 在日志数据量达到一定量的时候,根据配置或外部发送的命令,重建AOF log
Aof相关配置(redis.conf):
appendonly yes
是否开启AOF持久化,yes开启,no不开启
appendfilename appendonly.aof
指定AOF日志文件名称,默认名称:appendonly.aof
appendfsync everysec
什么时候将数据写入disk,redis提供三种模式:
no : 不进行fsync,有OS决定数据刷盘的时间粒度, 性能高
always : 每次写操作都做fsync , 安全
everysec : 上一个fsync后至少1s, 折中
no-appendfsync-on-rewrite no
当Aof log进行重写时,是否写日志时fsync。如果系统遇到latency问题,建议设为yes(rewrite时不强制fsync)
auto-aof-rewrite-percentage 100
当Aof log增长超过指定比例时,重写log file, 设置为0表示不自动重写Aof log
auto-aof-rewrite-min-size 64mb
启动重写Aof log时,Aof log的最小大小
相关文章推荐
- windows下安装redis
- 在Redis集群中使用pipeline批量插入
- redis_py发布/订阅方法
- redis-py API
- Redis单机多实体安装与主从配置
- redis windows下的环境搭建
- php与redis使用经验分享
- loadrunner 缺少vc2005_sp1_with_atl_fix_redist 组件
- tomcat-session-redis配置(session共享)
- spring 的 RedisTemplate解决Serializer
- redis实战之使用redis实现排行榜
- CentOS上安装redis
- CentOS上安装redis
- CentOS上安装redis
- CentOS上安装redis
- Tomcat7+Redis存储Session(转)
- redis sentinel 主从切换(failover)解决方案
- phpredis 中文手册和redis 教程
- 安装PHP扩展-----phpredis
- redis 的两种持久化方式及原理