First of all, of course, I was looking for answers online. Almost all of them asked me to delete the mongod.lock file and start it with repair.
Follow the operation as follows:
Of course, before I checked the information, I didn't think that it would be repaired once, so what should I do? I started to check my conf file and the following information:
At first glance, there seems to be no problem, but the replSet field does not seem to be right. Let's interpret the above field information:
dbpath#Data storage directory logpath#Log file directory replSet#Replica set name, the same replica set, the name must be consistent port#mongodb port fork=true# running in the background
For the replica set to work normally, I have tried this. It requires two or more nodes, but I have only one machine here, which cannot be successfully elected, so there is no master node.
When I delete this field from the conf file and start repair again, mongod starts normally, OK, everything is normal.