mongodb resolves an error that cannot connect to the server

Source: Internet
Author: User

Note: This solution to this problem is premised on the previous open MongoDB, once again use the time can not connect (using Mongod and MONGO are not correct)

Gossip: It's annoying to have this kind of problem, so say Sun's beach, okay ~ cool

Business:

The errors you may encounter are as follows:

MongoDB Shell version:2.4.9
Connecting To:test
Mon Mar 3 23:45:09.491 error:couldn ' t connect to server 127.0.0.1:27017 at src/mongo/shell/mongo.js:145
Exception:connect failed

The cause of the problem is that the last time it did not shut down properly, and the last time it did not shut down MONGO, causing the file to hold the data is occupied and locked.

The solution is also very simple, but it is not my own idea, is found on the Internet solution:

Simply remove the Mongod.lock file from the/data (database directory).

mongodb resolves an error that cannot connect to the server

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.