Persistent RDB for Redis

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.