MongoDB installation and configuration, encountering problems and workarounds

Source: Internet
Author: User

I do not know how, whim want to reinstall and configure MongoDB, before oneself also according to others to the whole, the impression is not profound. The second time the installation configuration encountered many problems.
After two hours, I encountered many problems:

Major problems encountered 1. Access Denied:

FIX: See if it is in admin mode net start MongoDB

2. The service does not respond to control solutions:

See if it is running in command-line mode Mongod--dbpath=d:\mongodb\data--logpath=d:\mongodb\logs\mongodb.log--logappend--servicename MongoDB--install.

3. Error 100 and 48 workaround:

Generally when running net start MongoDB it may be reported 100 or 48 error, this time go to your MongoDB folder to find the previous log file, Mongodb.log, in which you will see the cause of your error, I listed here a few common errors:
A. Port is occupied this can change the port that was set when it was turned on, or find a service that consumes ports to turn it off
B. DBPath and LogPath may not be set up: At this point the service will be open successfully to the start of the failed state repeatedly
C. Perhaps due to the last abnormal shutdown MongoDB caused MongoDB to be locked, find the Data\db\mongodb.lock file to delete it

4. I have inadvertently run two run Mongod--dbpath=d:\mongodb\data--logpath=d:\mongodb\logs\mongodb.log--logappend in admin mode-- ServiceName MongoDB--install, the advent of MongoDB service is starting, MongoDB service failed to start: I find the solution on the Internet:

Locate the Data\db\mongodb.lock file, delete it, and then run the net start MongoDB

5. The most painful thing is that I downloaded two times, the installation was configured two times, or the service did not respond to control, or other errors occurred. Workaround:

In administrator mode, run the SC delete MongoDB and delete the MongoDB service.
Then follow the online tutorial: http://www.cnblogs.com/lzrabbit/p/3682510.html, re-get it again, basically no problem. If there are problems during the period, refer to the above 4, if not, you find the online God solution.

Installation and configuration:

1. Download MongoDB from official website and install to D:\MongoDB.

2. Create data and logs two folders in D:\MongoDB, respectively, and store the database and log files. Create a Mongodb.log file in the Logs folder.

3. To be able to run better, I configured the environment variable on my computer:

4. Enter Mongod--dbpath D:\MongoDB\data in the command line

Then enter http://localhost:27017/in the browser and you'll see

5. Then enter Mongod--dbpath=d:\mongodb\data--logpath=d:\mongodb\logs\mongodb.log--logappend--servicename in admin command line mode MongoDB--install
Special note is in Administrator mode (win10 shortcut key win+x).
6. In administrator mode, net start MongoDB, the service will start normally. Special reminders are launched in Administrator mode (win10 shortcut win+x)

It feels good to get out and keep trying.

MongoDB installation and configuration, encountering problems and workarounds

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.