MongoDB startup problem resolution is occurring.

Source: Internet
Author: User
Tags signal handler mongo shell

Before the start of MongoDB is quite normal, do not know the start error later, the paste out query. Finally know is due to their abnormal shutdown caused by this situation.

--Excerpt: MongoDB abnormal shutdown after repair record

Mongod no background execution, after the terminal connection is not properly disconnected, perform the Mongod error again, as follows:

[[email protected] mongodb]#./bin/mongod/bin/mongod--help for help and startup options Thu Nov 22:42:49 Thu No V 22:42:49 warning:32-bit servers don ' t has journaling enabled by default. Please use the--journal if you want durability. Thu Nov 22:42:49 Thu Nov 22:42:49 [Initandlisten] MongoDB starting:pid=3257 port=27017 dbpath=/data/db/32-bit hos T=localhost Thu Nov 22:42:49 [initandlisten] Thu Nov 22:42:49 [Initandlisten] * * Note:when using MongoDB + bit, yo U is limited to about 2 gigabytes of data Thu Nov 22:42:49 [Initandlisten] **       See Http://blog.mongodb.org/post/137788967/32-bit-limitations Thu Nov 22:42:49 [Initandlisten] **        with--journal, the limit is lower Thu Nov 22:42:49 [Initandlisten] Thu Nov 22:42:49 [initandlist EN] db version v2.0.1, pdfile version 4.5 Thu Nov 22:42:49 [Initandlisten] git version:3a5cf0e2134a830d38d2d1aae7e88ca c31bdd684 Thu Nov 17 22:42:49 [Initandlisten] Build info:linux domu-12-31-39-01-70-b4 2.6.21.7-2.fc8xen #1 SMP Fri Feb 12:39:36 EST i686 BOOST _lib_version=1_41 Thu Nov 22:42:49 [Initandlisten] options: {} ************** unclean shutdown detected. Visithttp://dochub.mongodb.org/core/repair for recovery instructions. Thu Nov 22:42:49 [Initandlisten] exception in initandlisten:12596 old lock file, terminating Thu Nov 17 22:42:49 dbexit:thu Nov 22:42:49 [Initandlisten] shutdown:going to close listening sockets ... Thu Nov 22:42:49 [Initandlisten] shutdown:going to flush diaglog ... Thu Nov 22:42:49 [Initandlisten] shutdown:going to close sockets ... Thu Nov 22:42:49 [Initandlisten] shutdown:waiting for FS preallocator ... Thu Nov 22:42:49 [Initandlisten] shutdown:closing All Files ... Thu Nov 22:42:49 [Initandlisten] Closeallfiles () finished Thu Nov 22:42:49 dbexit:really exiting now

Repair method:

This is a mongod startup of a common error, the illegal shutdown, the lock file did not kill, the second boot when the check to have the lock file, the error is reported.

Workaround: Enter the data directory specified when the Mongod was last started--dbpath=/data/mongodb

Delete the file:

Rm/data/mongodb/mongo.lock--linux

Del/data/mongodb/mongo.lock--windows

Re-execution:

./mongod--repair

Start:

/usr/local/src/mongodb-linux-x86_64-2.0.2/bin/mongod--port=27017--pidfilepath=/var/run/mongod.pid--dbpath=/ Data/mongodb--directoryperdb--nojournal--noauth

OK, problem solved.

method to properly close Mongod: Enter MONGO shell

Use admin

Db.shutdownserver ()

It can also be brutally killed according to the document, and it should have a kill signal handler inside it.

Killall Mongod

Please do not kill-9, will cause file data confusion lost repair also powerless.

CTRL + C can exit the MONGO interface or ext

MongoDB Startup problem resolution is occurring.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.