Learn MongoDB Three: A workaround that MongoDB cannot start

Source: Internet
Author: User
Tags mongodb server

Original: http://blog.csdn.net/congcong68/article/details/46764815

A Brief introduction

We introduced MongoDB introduction (Installation and configuration), today when we open mongdb, we first run Cmd.exe into the DOS command interface, and then into the CD D:\mongodb\bin directory, start the service or MONGO command all reported errors.

Two Solve

1.net Stop mongdb Start Service: System error 5

Solve:

When running Cmd.exe into the DOS command interface, and then into the Cdd:\mongodb\bin directory, run Cmd.exe before you need to run as administrator, permissions are relatively high. Then tap Start service net start Mongdb

2.mongo command appears: The target computer is actively rejecting the inability to connect

Analysis:

net start Mongdb Runtime, the prompt service starts normally, but when the MONGO command is knocked out, the problem arises because MongoDB has not started MongoDB and we are connected to MongoDB, which is definitely a link failure.

Solve:

Removed the data/ Mongod.lock file, non-secure shutdown, needs to be removed, cause Mongod.lock file is a lock file created on the hard disk after the MongoDB server is started, and if it shuts down properly, it will affect the next boot Mongod service, locate the previously MongoDB unpacked disk and configure the storage log and data directory, such as my extracted directory D:\mongodb, is configured with the Data directory is D:\mongodb\data delete mongod.lock file under this file

Then the start service knocks the MONGO command to run normally

Description

If you exit the Mongod service normally, the file will not affect the next time the Mongod service is started, Mongod.lock size is 0 bytes, even if it exists.

Learn MongoDB Three: A workaround that MongoDB cannot start

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.