前言
2018-07-20T22:42:08.645+0800 I STORAGE [initandlisten] exception in initAndListen: DBPathInUse: Unable to lock the lock file:
(Unknown error). Another mongod instance is already running on the /data/db directory, terminating.
2018-07-20T22:42:08.645+0800 I CONTROL [initandlisten] now exiting
2018-07-20T22:42:08.645+0800 I CONTROL [initandlisten] shutting down with code:100
解决
问题的出现:mongodb非正常关闭
仔细找找cmd上正在使用的文件路径,删除mongod.lock文件即可.(lock文件所在路径各有不同)。
手动删除或命令删除均可。
可能的问题如果你找到了mongod.lock文件,delete它时,提示正在使用,请关闭的话。
解决:打开任务管理器,找到 mongod ,结束进程,然后再删除 mongod.lock文件,最后重启服务。