Mongodb exits abnormally and an error will be reported during the next startup. Some say simply delete the mongod. Lock file. If deleting the Mongod. Lock file does not solve the problem, try deleting the lock file first
The. / bin/mongod -- repair -- dbpath /... /data/--repairpath /home/test/bakdataCopy the code
/home/test/ bakData /home/test/ bakData /… /data/ is the directory where mongodb stores data files. After this command is successfully executed, mongodb can be successfully started.