MongoDB installation Configuration Management--network excerpt

Source: Internet
Author: User

First, download the installation:

Address: On the MongoDB website , download the appropriate version of your computer system, install to the appropriate location. I downloaded here for:

Second, open service and close

To create the database directory D:\mongodb\data, next open the cmd Command Line window, switch to the D:\mongodb\bin directory to execute the following command (where--dbpath is the specified database storage directory, there are two "-"):

Mongod--dbpath D:\MongoDB\data

At this point, the command-line window prints some startup information, and the last line displays the following information to indicate that the launch was successful.

2014-04-23t10:38:48.391+0800 [Initandlisten] waiting for connections on port 27017

At this point in the browser input http://localhost:27017/can see the display information is:

1. After the installation is complete, my default installation is under C:\Program Files\mongodb, the full path of the bin directory is C:\Program Files\mongodb\server\3.2\bin (to be used later)

2. Open cmd (normal Open or administrator open can), enter the command CD C:\Program files\mongodb\server\3.2\bin into the bin directory

3. Continue to enter command Mongod--dbpath=d:/data/db (d:/data/db is the location of the database file I specified, of course, the default is c:/data/db)

4. If the former is the administrator of the CMD, then continue, or re-open the administrator status of CMD, if you already have a service name, such as MongoDB, then first delete this, SC delete MongoDB

5. Then re-enter the second section of the folder, enter the command mongod--logpath d:\data\log\MongoDB.log--logappend--dbpath d:\data\db--directoryperdb-- ServiceName MongoDB--install

6. Continue to enter directive net start MongoDB (MongoDB This is the fifth step of the specified service name)

Well, there may be some problems here: for example:

Requested option conflicts with current storage engine option for DIRECTORYPERDB; You requested true if the current server storage are already set to false and cannot be changed, terminating

This error is viewed in the log file set in D:\data\log\MongoDB.log, which is the fifth step. Baidu has no answer to this question.

The method of modification is: Pay attention to the sixth step of a word "directoryperdb", yes, remove. Then the command becomes Mongod--logpath d:\data\log\MongoDB.log--logappend--dbpath d:\data\db--servicename MongoDB--install this.

Then proceed to the sixth step (involving the removal of services, refer to step Fourth)

Although the service has been made into a Windows service, every time the database, you do not need to start the MONGO service first. But the shell connects to the database by first CD to the MONGO installed Bin directory: Very troublesome.

Next, write the bin directory into the system variable:

    1. Access to advanced system settings;
    2. Enter into the environment variable;
    3. Inside the system variable, find the variable named Path double-click to enter;
    4. Add at the end of the variable value; C:\Program Files\MongoDB\Server\3.2\bin (This is the bin directory of the MONGO installation directory, do not omit the semicolon), save;
    5. Create a new cmd, and try the input again mongo .

MongoDB installation Configuration Management--network excerpt

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.