Dbfilename redis.db//Persistent files
dir/home/redis/6379//directory where files are located
Save 900 1//900 seconds Modify a key to be saved once
Save 300 10//300 seconds Modify 10 keys to be saved once
Save 60 10000//60 seconds Modify 10,000 keys to be saved once
The above 3 save conditions should be viewed from the bottom up, with each condition being or the relationship
Rdbcompression Yes//enable compression
Rdbchecksum Yes//enable checksum
Stop-writes-on-bgsave-error Yes//error when dump data to disk terminates Redis write
[Email protected] ~]# redis-server/etc/redis/6379.conf
[Email protected] 6379]# pwd
/home/redis/6379
[email protected] 6379]# LL
[Email protected] 6379]# REDIS-CLI
127.0.0.1:6379> Set Site www.baidu.com
Ok
[Email protected] ~]# redis-benchmark-n 20000
[email protected] 6379]# LL
Total 124
-rw-r--r--1 root root 124100 May 5 13:37 redis.db
Set Nosave must be generated after the redis.db file, the condition that the file is generated must be 60 seconds (less than 60 seconds not generated)
127.0.0.1:6379> Set Nosave www.123.com
Ok
[Email protected] 6379]# pkill-9 Redis
Restart Redis again
127.0.0.1:6379> Get Site
"Www.baidu.com"
127.0.0.1:6379> Get Nosite
(nil)
This article is from the "Technical Blog" blog, please be sure to keep this source http://raytech.blog.51cto.com/7602157/1770578
Persistent RDB for Redis