zoukankan      html  css  js  c++  java
  • redis 的备份策略,最好使用:RDB-AOF 混合持久化

    相关资料:

    1. Redis 4.0 新功能简介:RDB-AOF 混合持久化:http://blog.huangz.me/2017/redis-rdb-aof-mixed-persistence.html
    2. 持久化(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 文件进行数据库还原。
    
  • 相关阅读:
    Linux
    bzoj 1834
    bzoj 1002 找规律(基尔霍夫矩阵)
    bzoj 1005 组合数学 Purfer Sequence
    bzoj 1601 最小生成树
    bzoj 1001 平面图转对偶图 最短路求图最小割
    bzoj 1192 二进制
    bzoj 1012 基础线段树
    bzoj 1044 贪心二分+DP
    bzoj 1011 近似估计
  • 原文地址:https://www.cnblogs.com/cag2050/p/10539371.html
Copyright © 2011-2022 走看看