MongoDB Installation and Environment construction under window platform

Source: Internet
Author: User
Tags install mongodb mongodb

First, introduce the advantages of the following mongodb:

· High scalability

· Distributed storage

· Low cost

· Flexible structure

MongoDB Installation and Environment construction under window platform:

1. Download the installation package or compress package

Official website Download: https://www.mongodb.com/download-center

Download and install directly after installation, select CUSTOMR during installation

2. Adding DB storage and log storage folders

In the place where you like to create a new folder to hold the database files, in this folder also need to create a new three folders (my is under the D disk), a data, a logs, a etc (config), the name can be customized.

Under etc, create a mongo.conf file with the following content:

#数据库路径

dbpath=d:\MongoDB\data\

#日志输出文件路径

logpath=d:\MongoDB\logs\mongodb.log

#错误日志采用追加模式, after configuring this option, the MongoDB log is appended to the existing log file instead of creating a new file

logappend=true

#启用日志文件, enabled by default

journal=true

#这个选项可以过滤掉一些无用的日志信息, set to False if you need to use Debug

quiet=false

#端口号 defaults to 27017

port=27017

#指定存储引擎 (the default is not to add this engine, if the error, we add in)

#storageEngine=mmapv1

To this MongoDB installation complete

3. Add service, configure environment variables, start service

After configuration is executed in cmd

Mongod--config D:\MongoDB\etc\mongo.conf can

Then open d:\MongoDB\logs\mongodb.log to view the log

The prompt in the red box starts successfully.

Every time this startup is a bit troublesome, we can install MongoDB into the service:

Mongod--config d:\MongoDBData\etc\mongo.conf--install--servicename "MongoDB" and then enter

Tip: The above command is performed as an administrator.

Next, execute the MONGO in the bin directory

Next, configure the environment variables:

I believe we all know where to configure the environment variables, here is not more said, see:

At the end of this, enjoy using MongoDB.

Have questions contact qq:412606846 (same number)

MongoDB Installation and Environment construction under window platform

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.