The mongo. Lock file was not deleted after Mongo stopped the service using db.shutdownServer.

  mongodb, question

I stopped the service using db.shutdownServer, which is shown in the log.
图片描述

Mongo.lock’s permission is also on, but it was not deleted successfully, which caused me to manually delete it the next time I started the process. What is the reason?

Well, the concept is misunderstood. Using shutdownServer command, mongo.lock file will not be deleted, but the pid of Mongo recorded in the file will be cleared, and the new pid will be written in the next time Mongo is restarted.