MongoDB Primary Series One: MongoDB Installation and recommended configuration

Source: Internet
Author: User

Presumably the first time I heard of the small friends of MongoDB, must have heard his many very n place to learn this stuff. No matter what purpose you are starting to embark on this journey of study, but also as a rookie I will be happy to grow with you. Needless to say, the various profiles are not written here, leaving only dry goods. Want to see the profile of you can find degrees Niang self-solve.

1, the first time to contact new things, of course, to the official website to turn.

MongoDB Website: https://www.mongodb.org/

Download the content as shown in:


If you click on the download page, do not pop up the download dialog box, click on the content shown. Note: Registration information is not required.



2. Installation

Download the MSI installation file directly by clicking Install. is actually a decompression process. I installed the D drive, and after the installation

You will see a bin directory and some documentation in the installation directory.

3. Configure the MongoDB for the relevant configuration

MongoDB after installation you will find this thing is very strange, click on the bin directory Mongo.exe or Mongod.exe is directly flash back.

Here are some brief configurations of MongoDB:

1) in the same directory as the bin directory to build a data folder, under the Data folder to create a DB and log folder to store data files and logs "PS: You can also create other folders, you know where you can"

2) build a Mongo.config file under the directory sibling of the bin directory, as a MongoDB configuration file. [PS: Will be used when starting up]

The contents of the mongo.config file are as follows:

# #数据文件dbpath =d:\mongodb\data\db # #日志文件logpath =d:\mongodb\data\log\mongo.log# error log with append mode After configuring this option, the MongoDB log is appended to the existing log file instead of creating a new file logappend=true# enabling the log file, enabling Journal=true #这个选项可以过滤掉一些无用的日志信息 by default. If debugging is required, set the falsequiet=false# port number to default to 27017port=27017


4, the simple configuration end, the following will usher in the exciting Helloword stage

CMD into the bin directory in the installation directory


Execute Mongod--config d:\mongodb\mongo.config

At this point you will be able to see some information. Without an error, you can proceed to the next step.

Create a new command window, also enter the bin directory, execute MONGO

At this point, if the configuration is not a problem, you should see the following page



5. Fast Start MongoDB

It is obviously unacceptable that each time you go through cmd to the bin directory and execute the relevant commands.

Advanced One

Add MongoDB Bin directory to the environment variables of the system, how to play the game can be played

Advanced Two

At this point we find that it is obviously inconvenient to add additional parameters each time it is started. There is a great God already

Gives the way to add as a Windows Service "PS: Find Yourself". But there are pros and cons. We always have some little partners with obsessive-compulsive disorder like

To operate it when it starts, it is obvious that it is cumbersome to operate with the start-up shutdown service.

Advanced Three

Now that we've already added it to the environment variable, and each time we execute the same command to start, why not consider the start command

Write a shortcut to it.

Do as you say.

Create a new shortcut on the desktop.


After the successful creation, when we want to start MongoDB directly click on this shortcut. Do not want to use, directly close the shortcut to open the window.

Is it convenient to have this? Ha ha.

The next article will briefly describe what some of the files that MongoDB created after performing these operations are content.

Reprint please indicate the original address of the article, respect the author's labor results.





Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

MongoDB Primary Series One: MongoDB Installation and recommended configuration

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.