Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

设置AOF持久化

  • 需要手动开启

    • /appendonly 搜索相关行
      • no 改为 yes
      • 重启服务后生效
    • 会稍微影响性能,但增加了数据安全性
  • AOF文件名

    • /appendfilename 搜索相关行
      • 默认值是"appendonly.aof",无需更改
  • 刷盘保存策略

    • /appendfsync搜索相关行
      • 默认值是everysec,代表每秒调用一次fsync()写入AOF文件,性能中等
      • 可以改成
        • no,表示随操作系统去写入,性能最好,但有可能几分钟才写一次
        • always (不建议使用) 表示每次有数据修改,都会调用fsync()写入AOF文件,性能很差,但非常安全