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--
Today, the editor shares with you a detailed introduction of how redis stores data. I believe most people don't know much about it. In order to make you understand better, the editor summed up the following content for you. Without saying much, let's move on.
Redis saves data to memory, but it also writes data to the hard disk on a regular basis.
There are two ways for Redis to save data:
Snapshot mode (Snapshot)
It supports two snapshot modes:
Timed snapshot, that is, the data in memory is saved to disk at a certain time.
Quantitative snapshot, that is, the data is saved to disk after a certain number of changes.
You can also combine these two methods, such as changing 1000 times and saving data more than 60 seconds from the last save time.
Write mode (Append Only File)
In this mode, Redis saves all commands that modify the data (such as Update,Set) into an ASAP file that can only be appended, and when Redis restarts, it reexecutes the commands in this file.
Where is the data saved?
The data is saved to a data file. The specific file name depends on the configuration file of Redis, namely Redis.conf.
Config get dbfilename (returns dump.rdb)
You can use config set dbfilename new (modify the file where you want to save the data)
How does the data get to export?
When Redis writes data, it first writes to a temp file, and then renames the temp file to a predefined file, so even if Redis is running, you can copy the file directly with the cp command.
Cp / usr/loca/redis/demo.rdb / home/greenerycn/db/demo.rdb
The above is the knowledge summary of redis storage data, the content is more comprehensive, the editor believes that there may be some knowledge points that we may see or use in our daily work. I hope you can learn more from this article.
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.