Error: child process failed, exited with error number
The above error was found this afternoon. The next application from GitHub down needs redis to start the service and mongodb to start the service before the application starts. Therefore, when mongodb is started, the tragedy appears
zhangzhi@moke:~$mongod--dbpath=/data/club--port=27017--fork--logpath=/var/log/mongodb/mongodb.log abouttoforkchildprocess,waitinguntilserverisreadyforconnections. forkedprocess:43110 alloutputgoingto:/var/log/mongodb/mongodb.log logfile[/var/log/mongodb/mongodb.log]existsandcouldn'tmakebackup[/var/log/mongodb/mongodb.log.2014-11-17T06-55-20];runwith--logappendormanuallyremovefile:errno:13Permissiondenied Badlogpathvalue:"/var/log/mongodb/mongodb.log";terminating. ERROR:childprocessfailed,exitedwitherrornumber1
The reasons for this error are as follows:
Most of it is because mongodb is locked when it is shut down abnormally. Think about it, it may be caused by the last unexplained crash
How to solve this problem:
delete the mongod.lock file and the log file mongodb.log.2014-11-17t06-55-20, and delete all the log logs if necessary
mongod –repair –dbpath /data/db/–repairpath /tmp/mongodb
root@moke:~#mongod--repair--dbpath/data/db/--repairpath/tmp/mongodb MonNov1715:19:15.374Youmustusea--repairpaththatisasubdirectoryof--dbpathwhenusingjournaling MonNov1715:19:15.375dbexit: MonNov1715:19:15.375shutdown:goingtocloselisteningsockets... MonNov1715:19:15.375shutdown:goingtoflushdiaglog... MonNov1715:19:15.375shutdown:goingtoclosesockets... MonNov1715:19:15.375shutdown:waitingforfspreallocator... MonNov1715:19:15.376shutdown:lockforfinalcommit... MonNov1715:19:15.376Assertionfailurecsrc/mongo/db/client.h235 0x1033e4d800x1033b85e70x10305cd470x10305cb1a0x10305ce970x10305e33d0x10305fd750x10312e69d0x102ef6c630x102ef26fd0x7fff8dd185c9 0mongod0x00000001033e4d80_ZN5mongo15printStackTraceERSo+64 1mongod0x00000001033b85e7_ZN5mongo12verifyFailedEPKcS1_j+295 2mongod0x000000010305cd47_ZN5mongo4Lock26ParallelBatchWriterSupport6relockEv+391 3mongod0x000000010305cb1a_ZN5mongo4Lock26ParallelBatchWriterSupportC2Ev+26 4mongod0x000000010305ce97_ZN5mongo4Lock10ScopedLockC2Ec+39 5mongod0x000000010305e33d_ZN5mongo4Lock10GlobalReadC2Ei+29 6mongod0x000000010305fd75_ZN5mongo11readlocktryC2Ei+53 7mongod0x000000010312e69d_ZN5mongo6dbexitENS_8ExitCodeEPKc+893 8mongod0x0000000102ef6c63_ZL25processCommandLineOptionsRKSt6vectorISsSaISsEE+14755 9mongod0x0000000102ef26fdmain+637 10libdyld.dylib0x00007fff8dd185c9start+1 MonNov1715:19:15.420shutdownfailedwithexception MonNov1715:19:15.420dbexit:reallyexitingnow
mongod–dbpath=/data/db–port=27017–fork—-logpath=/val/log/mongodb/mongodb.log
root@moke:~#mongod--dbpath=/data/db--port=27017--fork--logpath=/var/log/mongodb/mongodb.log abouttoforkchildprocess,waitinguntilserverisreadyforconnections. forkedprocess:43144 alloutputgoingto:/var/log/mongodb/mongodb.log logfile[/var/log/mongodb/mongodb.log]exists;copiedtotemporaryfile[/var/log/mongodb/mongodb.log.2014-11-17T07-21-41] childprocessstartedsuccessfully,parentexiting
OK, mongodb started successfully