Environment: centos7.2
Software: redis-3.2.10 (yum installation)
Scenario One: Before the company's Redis does not open aof mode, has been an RDB mode, but the data is very important, the data can not be lost, so need to open aof, but Redis default is to load data from appendonly.aof, Systemctl start Redis, the database is empty because we don't have a appendonly.aof file, and when you close Redis, the Dump.rdb is emptied
Scenario Two: Redis database migration, we can only use Dump.rdb files, because the Dump.rdb file is relatively small, easy to carry
The first step: in the/etc/redis.conf configuration file, we only open the RDB mode and start Redis so that the data files are loaded in
Step two: Use the REDIS-CLI command, log in to Redis, execute the bgrewriteaof command, regenerate the aof file
Step three: Turn off Redis and turn on aof mode in/etc/redis.conf
Fourth step: Re-open the Redis service, this time, Redis will read the appendonly.aof file, load the full database
Redis Database recovery database or database migration via Dump.rdb file