先說答案:全量數據。
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之后的命令的記錄,而是包括全部的數據庫記錄