Redis的AOF和RDB相互切换

一.从RDB切换到AOF

redis-cli
127.0.0.1:6379> save
OK
127.0.0.1:6379> CONFIG SET appendonly yes
OK
127.0.0.1:6379> save
OK
127.0.0.1:6379> shutdown save
not connected> 

修改redis配置,打开aof

vim redis.conf

appendonly yes

启动redis

redis-server redis.conf

二.从AOF切换到RDB

redis-cli
127.0.0.1:6379> save
OK
127.0.0.1:6379> CONFIG SET appendonly no 
OK
127.0.0.1:6379> save
OK
127.0.0.1:6379> shutdown save
not connected> 

修改redis配置,打开aof

vim redis.conf

appendonly no

启动redis

redis-server redis.conf

你可能感兴趣的:(redis,redis,nosql,数据库)