1, the error, resulting in MongoDB can not start normally. The specific commands are as follows (note the red font, prompt log path, can view the log file):
[Root@oraclelinux ~]# Service Mongod start
starting Mongod:fri you 09:59:59.385
Fri G:32-bit servers don ' t have journaling enabled by default. Please use the--journal if you want durability.
Fri 09:59:59.387 about
to fork the child process, waiting until server was ready for connections.
Forked process:2120 all
output going to:/var/log/mongo/mongod.log
error:child process failed, exited with ERROR Number
[failed]
Through the output information, the day file is/var/log/mongo/mongod.log
The error message is:
Error:child process failed, exited with error number 100
2, view the contents of the Mongod.log file, the specific orders are as follows:
The contents of the log are longer, and the relevant content is intercepted here as follows:
unclean shutdown detected.
Please visit Http://dochub.mongodb.org/core/repair for recovery instructions.
Thu 12:34:11.293 [Initandlisten] exception in initandlisten:12596 old lock file, terminating
thu 12:34:11.293 dbexit: Thu the 12:34:11.293
[Initandlisten] shutdown:going to close listening sockets. .
Thu 12:34:11.293 [Initandlisten] shutdown:going to flush diaglog ...
Thu 12:34:11.293 [Initandlisten] shutdown:going to close sockets ...
Thu 12:34:11.293 [Initandlisten] shutdown:waiting for FS preallocator
... Thu 12:34:11.293 [Initandlisten] shutdown:closing all files ...
Thu 12:34:11.293 [Initandlisten] Closeallfiles () finished Thu and 12:34:11.293 dbexit:really
This is an illegal shutdown of the MongoDB, based on the date provided in the specific content of the address (line 3rd) to obtain the repair method.
A, first delete the/var/lib/mongo/directory under the Mongod.lock file, the specific commands are as follows:
[Root@oraclelinux ~]# Rm/var/lib/mongo/mongod.lock
b, has been repair way to start MongoDB, the specific commands are as follows:
[Root@oraclelinux mongo]# mongod-f/etc/mongod.conf--repair Fri have been 10:38:39.112 Fri
Ing:32-bit servers don ' t have journaling enabled by default. Please use the--journal if you want durability.
Fri 10:38:39.114 about
to fork the child process, waiting until server was ready for connections.
Forked process:2237 all
output going to:/var/log/mongo/mongod.log child
Process started successfully, parent ex Iting
C, at the start of a MongoDB, the specific orders are as follows:
[Root@oraclelinux mongo]# mongod-f/etc/mongod.conf Fri You have been in 10:41:13.664 Fri
It servers don ' t have journaling enabled by default. Please use the--journal if you want durability.
Fri 10:41:13.666 about
to fork the child process, waiting until server was ready for connections.
Forked process:2253 all
output going to:/var/log/mongo/mongod.log child
Process started successfully, parent ex Iting
D, view the process, if there is a mongodb process, that represents the successful repair, the specific commands are as follows:
[Root@oraclelinux mongo]# Ps-ef | grep MONGO
root 2253 1 2 10:41? 00:00:02 mongod-f/etc/mongod.conf
root 2268 2079 0 10:43 pts/0 00:00:00 grep MONGO
3, start to use MongoDB, the specific orders are as follows:
[Root@oraclelinux mongo]# MONGO
MongoDB shell version:2.4.9 connecting to:test
Server has startup warnings :
Fri 10:41:13.708 [Initandlisten] Fri before
10:41:13.708 [Initandlisten] * * Note:this is a bit mongod B binary.
Fri 10:41:13.708 [Initandlisten] * * bit builds are limited to less than 2GB of data (or less with--journal) .
Fri 10:41:13.708 [Initandlisten] * * * This journaling defaults to off for the bit and is currently off.
Fri 10:41:13.708 [Initandlisten] * * http://dochub.mongodb.org/core/32bit
Fri 24 10:41:13.708 [ Initandlisten]