日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 综合教程 >内容正文

综合教程

redis中的aof模式,产生的是增量数据,还是全量数据?

發布時間:2023/12/29 综合教程 31 生活家
生活随笔 收集整理的這篇文章主要介紹了 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之后的命令的記錄,而是包括全部的數據庫記錄

總結

以上是生活随笔為你收集整理的redis中的aof模式,产生的是增量数据,还是全量数据?的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。