Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Persistent RDB of Redis

2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Dbfilename redis.db / / persistent file

The directory where the dir / home/redis/6379 / / file is located

Save 9001 / / 900s modify a key and save it once

Save 30010 / 300s modify 10 key and save once

Save 60 10000 / / 10000 key modified in 60 seconds will be saved once

/ / the above three save conditions should be viewed from the bottom up, and each condition is or.

Rdbcompression yes / / enable compression

Rdbchecksum yes / / enable checksum

Stop-writes-on-bgsave-error yes / / terminates the writing of redis when there is an error in the dump data to disk

[root@hdtest20 ~] # redis-server / etc/redis/6379.conf

[root@hdtest20 6379] # pwd

/ home/redis/6379

[root@hdtest20 6379] # ll

[root@hdtest20 6379] # redis-cli

127.0.0.1 purl 6379 > set site www.baidu.com

OK

[root@hdtest20] # redis-benchmark-n 20000

[root@hdtest20 6379] # ll

Total 124

-rw-r--r-- 1 root root 124100 May 5 13:37 redis.db

Set nosave must be after the redis.db file is generated, the condition for generating the file must be 60 seconds (not generated in less than 60 seconds)

127.0.0.1 purl 6379 > set nosave www.123.com

OK

[root@hdtest20 6379] # pkill-9 redis

Restart redis again

127.0.0.1 purl 6379 > get site

"www.baidu.com"

127.0.0.1 purl 6379 > get nosite

(nil)

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report