Redis持久化之AOF
todo
AOF实验
1.redis写操作
27.0.0.1:6379> set hello world OK 127.0.0.1:6379> set hello php OK 127.0.0.1:6379> set hello java OK 127.0.0.1:6379> set hello jack OK 127.0.0.1:6379> set zhang san OK 127.0.0.1:6379> set li si OK 127.0.0.1:6379> set li xiaolong OK
上述操作多次覆写hello,li两个key。
2.查看aof日志文件
$ sudo cat -b /var/lib/redis/appendonly.aof REDIS0009? redis-ver5.0.3? ? 2 ?ctime??]used-mem?? aof-preamble??$e???q ?*2 $6 SELECT $1 0 *3 $3 set $5 hello $5 world *3 $3 set $5 hello $3 php *3 $3 set $5 hello $4 java *3 $3 set $5 hello $4 jack *3 $3 set $5 zhang $3 san *3 $3 set $2 li $2 si *3 $3 set $2 li $8 xiaolong
3.重写aof
127.0.0.1:6379> bgrewriteaof Background append only file rewriting started
4.查看重写后的aof日志文件
:~$ sudo cat -b /var/lib/redis/appendonly.aof 1 REDIS0009? redis-ver5.0.3? ? 2 ?ctime????]used-mem?? aof-preamble???zhangsanlxiaolonghellojack??X?-???
相关推荐
温攀峰 2020-10-23
王道革 2020-11-25
wangdonghello 2020-11-03
Langeldep 2020-11-16
chenhualong0 2020-11-16
聚合室 2020-11-16
koushr 2020-11-12
MRFENGG 2020-11-11
guoyanga 2020-11-10
fackyou00 2020-11-10
Orangesss 2020-11-03
dongCSDN 2020-10-31
rainandtear 2020-10-30
Quietboy 2020-10-30
liuyulong 2020-10-29
fansili 2020-10-29
jackbon 2020-10-19
kaixinfelix 2020-10-04