In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Redis is actually a program written in C language, this program is used to store key-value data, the data is first stored in memory, and then written to the disk specified location.
Let's sort out the two ways of Redis storage: RDB and AOF
The first way: RDB (Redis DataBase)
RDB writes data to a temporary file. After persistence, the last persisted file is replaced with this temporary file to achieve data recovery.
Rdis database storage method is to store the data in a xxx.rdb file. The data saved in the file is the in-memory data in redis. The default storage mode is efficient, the access to the disk is reasonable, and the monitoring of memory data also has a certain critical value to ensure that the data is not lost as much as possible.
Redis.conf
# In the example below the behaviour will be to save:# after 900 sec (15 min) if at least 1 key changed# after 300 sec (5 min) if at least 10 keys changed# after 60 sec if at least 10000 keys changed# Note: you can disable saving completely by commenting out all "save" lines.# It is also possible to remove all the previously configured save# points by adding a save directive with as ingle empty string argument# like in the following example:# save "# rules for persistent data. RDB persistence rule. The file in which the data is stored is determined by the dbfilename parameter save 900 1save 300 10save 60 1000 persistent RDB file name. Absolute path configuration can be used, and if there is no path configuration, addressing exists at the relative location where the command runs. Dbfilename dump.rdb
The second way: AOF (appendonly file)
AOF records the instructions that have been executed, and when the data is recovered, the instructions are executed again in the order from front to back to achieve data recovery.
Among them, AOF is disabled and enabled by default, and the configuration file redis.conf:appendonly yes is modified.
Append of file storage mode. The resource requirements for disk and IO are much higher than those for rdb. It has a great impact on the performance of the redis server. Aof and rdb can be turned on at the same time, but when redis is restarted, the log of data changes saved in aof will be read first. It is not recommended to enable it at the same time, the pressure on the disk and IO is too high. Rdb is recommended.
# whether to enable append of file persistence. The default is turned off. # data is persisted once per second. Persist to the data file by appending. the name of the file in the appendonly no# aof persistent way. appendfilename "appendonly.aof"
These are the details of redis storage, please pay more attention to other related articles!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.