八十六:redis之RDB和AOF两种数据持久化机制
详见:http://redisdoc.com/persistence/index.html

redis.conf
RDB机制


改为5秒内1次


文件已生成

关闭RDB,注释掉3个save,重启redis即可生效

再插入数据,已无备份


AOF机制:
appendonly yes:开启AOF机制

同步机制
appendfsync always:只要发生数据更新,就同步到aof文件中
appendfsync everysec:每秒同步一次
appendfsync no:关闭同步机制,使用操作系统的同步机制(30秒一次)

讨论群:249728408

浙公网安备 33010602011771号