mongo.lock文件的用途是什么? [英] What is the use of the mongo.lock file?
问题描述
我正在使用mongodb-v1.8.1.不幸的是我的服务器被挂起,我重新启动了服务器,一旦回来我就无法启动MongoDB.我删除了mongo.lock文件并运行了修复数据库查询.现在mongo可以正常工作了.我对mongo.lock文件感到困惑.mongo.lock文件的用途是什么?删除mongo.lock文件会影响我现有的数据吗? 请让我知道您的建议.
I am using mongodb-v1.8.1. Unfortunately my server gets hanged and i restarted my server.Once it comes back i could-not start the MongoDB. I removed the mongo.lock file and ran repair database query.Now mongo working fine. I am baffled with the mongo.lock file.What is the use of the mongo.lock file?.Removing the mongo.lock file will affect my existing data? Please let me know your suggestion..
谢谢
推荐答案
Mongodb总是在服务器启动时创建mongodb.lock文件,并在mongodb停止之前将其删除.
Mongodb always creates the mongodb.lock file when the server starts and drops it before mongodb is stopped.
删除mongodb.lock不会影响任何数据,仅表示mongodb没有正确停止.因此,删除该文件是正确的,并且使用-repair选项运行应该可以修复数据库.
Removing mongodb.lock does not affect any data it just means that mongodb was not stopped correctly. So, you are correct in removing this file and running with the -repair option should fix database.
这篇关于mongo.lock文件的用途是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!