Windows installation MONGODB2

Source: Internet
Author: User
Tags create mongodb

installation files: Mongodb-win32-x86_64-2008plus-ssl-3.2.6-signed.msi

PC configuration: Win7 64-bit

MongoDB installation is very simple, set up the installation path, always next until the end of the installation, the largest pit is the installation of MongoDB service, the following specific after the MongoDB installation of some configuration operations

The "claim" My installation path is: D:\Program files\mongodb\server\3.2

1. Create the database path (data directory), log path (logs directory), and log file (Mongo.log file), as shown in

2. Create the configuration file mongo.conf, the file contents are as follows:

    1. Dbpath=d:\program Files\mongodb\server\3.2\data #数据库路径
    2. Logpath=d:\program Files\mongodb\server\3.2\logs\mongo.log #日志输出文件路径
    3. Logappend=true #错误日志采用追加模式
    4. Journal=true #启用日志文件, enabled by default
    5. Quiet=true #这个选项可以过滤掉一些无用的日志信息, set to False if you need to use Debug
    6. port=27017 #端口号 defaults to 27017

3. Start MongoDB

After the first two steps are completed, you can start MongoDB, first enter the D:\Program files\mongodb\server\3.2\bin (depending on the installation directory) directory, the Start command is as follows:

    1. Mongod--config "D:\Program files\mongodb\server\3.2\mongo.conf"

After the command executes, enter http://127.0.0.1:27017 in the browser to see the following interface that indicates the success of the launch

4. Create and start the MongoDB service

If every time you follow step three, it would be quite a hassle to create and start the MongoDB service by following the command below, you can manage the startup and shutdown of MongoDB through the Windows service

First enter the D:\Program files\mongodb\server\3.2\bin (depending on the installation directory) directory, the Start command is as follows:

    1. Mongod--config "D:\Program files\mongodb\server\3.2\mongo.conf"--install--servicename "MongoDB"
    2. net start MongoDB

If you need to uninstall MongoDB service, first enter D:\Program Files\mongodb\server\3.2\bin (depending on the installation directory) directory, execute the following command:

    1. Mongod.exe--remove--servicename "MongoDB"

At this point, all operations have been completed and the service has been successfully installed.

PostScript: The initial installation of the service is installed with SC, the command is as follows:

    1. SC create MongoDB binpath= "D:\Program files\mongodb\server\3.2\bin\mongod.exe--service--config=d:\program Files\ Mongodb\server\3.2\mongo.conf "

After execution can create the service, but unable to start the MongoDB service, each boot will prompt 1053 error, based on the search solution to try the following command or not resolved

    1. Mongod.exe--bind_ip 127.0.0.1--logpath "D:\Program files\mongodb\server\3.2\logs\mongo.log"--logappend--dbpath "D : \program Files\mongodb\server\3.2\data "--directoryperdb--servicename MongoDB--install

from:http://blog.csdn.net/mzbonnt/article/details/51461331

Windows installation MONGODB2

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.