In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Recently, I have been developing with mongodb. On linux, it is customary to use kill-9 PID to shut down the service.
As a result, every time you shut down and restart mongodb, mongodb always shuts down itself. Look at the log also did not see what to come, and then Baidu.
It is found that the consequences of killing mongodb with kill-9 are quite serious.
Then I went to the official website to check it out.
MongoDB uses a memory-mapped storage engine:
It converts disk IO operations into memory operations, if it is a read operation, the data in memory acts as a cache, and if it is a write operation, memory can also convert random write operations into sequential write operations, which can greatly improve performance.
The write operation is flush to disk every 60 seconds (set by syncdelay). If the flush is stopped within these 60 seconds and we do kill-9, then all write data since the last flush will be lost.
If you execute kill-9 while the flush operation is in progress, it will cause file confusion and may result in the loss of all data.
Official description:
Sending a KILL signal kill-9 will probably cause damage as mongod will not be able to cleanly exit. In such a scenario, run the repairDatabase command.
Fortunately, I found it early. Otherwise, there may be some accident.
Finally, it is found that mongodb can be turned off in the following ways
1. Use killall mongod
2. Use kil-15 PID
3. Execute the db.shutdownServer () command under the admin user
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.