zoukankan      html  css  js  c++  java
  • redis中的aof模式,产生的是增量数据,还是全量数据?

    先说答案:全量数据。

    1、修改redis.conf,开启rdb,禁用aof

    上面这个是持久化文件的路径,我们ll看下:

    2、启动redis后,cli查看里面的key

    [root@mini1 redis-4.0.2]# src/redis-server ./redis.conf 

    [root@mini1 redis-4.0.2]# src/redis-cli 


    3、现在转换为aof模式

    在线转换参考:https://redis.io/topics/persistence

    How I can switch to AOF, if I'm currently using dump.rdb snapshots?
    There is a different procedure to do this in Redis 2.0 and Redis 2.2, as you can guess it's simpler in Redis 2.2 and does not require a restart at all.
    Redis >= 2.2
    Make a backup of your latest dump.rdb file.
    Transfer this backup into a safe place.
    Issue the following two commands:
    redis-cli config set appendonly yes
    redis-cli config set save ""
    Make sure that your database contains the same number of keys it contained.
    Make sure that writes are appended to the append only file correctly.
    The first CONFIG command enables the Append Only File. In order to do so Redis will block to generate the initial dump, then will open the file for writing, and will start appending all the next write queries.
    The second CONFIG command is used to turn off snapshotting persistence. This is optional, if you wish you can take both the persistence methods enabled.
    IMPORTANT: remember to edit your redis.conf to turn on the AOF, otherwise when you restart the server the configuration changes will be lost and the server will start again with the old configuration.
    

      

     在客户端cli执行:

    config set appendonly yes

    config set save ""

     4、新增几个key,生成aof文件,查看内容是否包含rdb中的内容

    [root@mini1 backup]# less appendonly.aof 

    结果如下:

    综上:说明aof生成的文件不是增量的,不是仅仅生成开启aof之后的命令的记录,而是包括全部的数据库记录

  • 相关阅读:
    攻防世界Web Cat和ics-05
    攻防世界 WEB lottery 和 ics-06
    python3下robot framework ride 测试环境搭建
    python2下robot framework ride 测试环境搭建
    自动化测试的目的与本质
    自动化回归测试执行效率探讨
    selenium+python元素定位总计及实例说明
    Mac上安装Selenium+Python+PyCharm
    mac本安装fiddler抓包工具(普遍认为fiddler的mac版不好用)
    浅谈app运行日志
  • 原文地址:https://www.cnblogs.com/grey-wolf/p/7686835.html
Copyright © 2011-2022 走看看