Redis senior (a) of Redis data backup and recovery

Redis Redis advanced data backup and recovery of

Redis the SAVE command creates a backup of the current database
syntax
redis Save command basic syntax is as follows:

redis 127.0.0.1:6379> SAVE 

Examples

redis 127.0.0.1:6379> SAVE 
OK

This command creates dump.rdb redis file in the installation directory

Data recovery

If you need to restore data, simply backup file (dump.rdb) move to redis installation directory and start the service. Get redis directory CONFIG command may be used, as follows:

redis 127.0.0.1:6379> CONFIG GET dir
1) "dir"
2) "/usr/local/redis/bin"

The above command CONFIG GET dir output redis installation directory is / usr / local / redis / bin.

Bgsave

Redis create backup files can also use the command bgsave , the command executes in the background.
Examples

127.0.0.1:6379> BGSAVE
Background saving started
Published 100 original articles · won praise 33 · views 5847

Guess you like

Origin blog.csdn.net/JAVA_I_want/article/details/103332207