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

Example Analysis of basic configuration of redis

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

Share

Shulou(Shulou.com)05/31 Report--

This article will explain in detail the sample analysis of the basic configuration of redis. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.

Redis ms master-slave cluster functions: 1, master-slave backup to prevent downtime 2, read-write separation, sharing master tasks 3, task separation

Redis's MS synchronization principle: MS automatically connects, S initiates synchronization, M begins to DUMP out RDB,S to receive M's RDB and stores it in its own memory. In the process of M doing DUMP, new data is generated. M will buffer the new data into AOF. When M finishes DUMP, it also sends AOF to SLAVE to complete a synchronization.

There are two ways to persist Redis: RDB and AOF

Configuration options for Rdb Snapshot

If there is one write in save 9001 / 900, a snapshot is generated.

Save 1000 / / if there are 1000 writes in 300 seconds, a snapshot is generated

Save 60 10000 / / if there are 10000 writes in 60 seconds, a snapshot is generated

(if all three options are masked, rdb is disabled)

When there is an error in the stop-writes-on-bgsave-error yes / / background backup process, does the main process stop writing?

Whether the exported rdb file of rdbcompression yes / / is compressed

Rdbchecksum yes / / when importing rbd recovery data, do you want to verify the integrity of rdb?

Dbfilename dump.rdb / / exported rdb file name

The placement path of dir. / rdb

Configuration of Aof

Appendonly no # whether to turn on aof logging function

Appendfsync always # every command is immediately synchronized to aof. Safe, slow

Appendfsync everysec # compromise, write once per second

Appendfsync no # write work to the operating system, the operating system to determine the size of the buffer, unified write to aof. Low synchronization frequency and high speed

No-appendfsync-on-rewrite yes: # do you want to stop synchronizing aof while exporting rdb snapshots?

Auto-aof-rewrite-percentage 100 # aof file size compared to the size of the last rewrite, when the growth rate is 100%, rewrite

Auto-aof-rewrite-min-size 64mb # aof file, overridden when it exceeds at least 64m

This is the end of this article on "sample Analysis of redis basic configuration". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.

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

Database

Wechat

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

12
Report