Mongodb — startup exception, error report ERROR:NUMBER 100

When doing sharding — replica set, I missed a port and wanted to restart one of mongod, but I always reported an error

 

 

[ root@centos mongodb]# mongod –port 28018 –shardsvr –replSet shard1 –dbpath=/usr/local/mongodb/shard1_ 3 –logpath=/usr/local/mongodb/shard1_ 3/shard1_ 3.log –logappend –fork
Fri Apr 11 13:24:48.136
Fri Apr 11 13:24:48.136 warning: 32-bit servers don’t have journaling enabled by default. Please use –journal if you want durability.
Fri Apr 11 13:24:48.136
about to fork child process, waiting until server is ready for connections.
all output going to: /usr/local/mongodb/shard1_ 3/shard1_ 3.log
forked process: 5281
ERROR: child process failed, exited with error number 100

I checked online and found that it seems that I used violence to shut down DB before, resulting in data locking.

You need to enter the database directory and delete it mongod.lock Then, restart. That’s it.

 

 

In addition, the correct way to close mongodb.

1.kill -2 PID

2.use admin;

  db.shutdownServer ()



More attention is paid to the official account “Python column”. The background reply to “Tencent architecture resource 1” gets the big data resources prepared by Tencent architects.

Read More: