相關資料:
- Redis 4.0 新功能簡介:RDB-AOF 混合持久化:http://blog.huangz.me/2017/redis-rdb-aof-mixed-persistence.html
- 持久化(persistence):http://redisdoc.com/topic/persistence.html?highlight=持久化
############################## APPEND ONLY MODE ###############################
# By default Redis asynchronously dumps the dataset on disk. This mode is
# good enough in many applications, but an issue with the Redis process or
# a power outage may result into a few minutes of writes lost (depending on
# the configured save points).
#
# The Append Only File is an alternative persistence mode that provides
# much better durability. For instance using the default data fsync policy
# (see later in the config file) Redis can lose just one second of writes in a
# dramatic event like a server power outage, or a single write if something
# wrong with the Redis process itself happens, but the operating system is
# still running correctly.
#
# 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 no
自己翻譯:
默認情況下,Redis 異步保存數據庫到磁盤。這個模式適用於很多應用,但是 Redis 進程出錯或者斷電,會導致幾分鍾的寫數據丟失(依賴於 `save` 配置項)。
AOF 是另一個持久化策略,它提供了更好的持久性。如果使用了默認的 AOF 數據 `fsync` 策略,當斷電或 Redis 服務器進程出錯,Redis 僅丟失一秒鍾的寫數據。
AOF 和 RDB 持久化策略,可以同時啟用。如果啟用了 AOF,Redis 啟動時,將優先使用 AOF 文件進行數據庫還原。