Setting up a MongoDB server as a Windows Startup service (WIN10)

Source: Internet
Author: User
Tags mongodb server

Title, this problem also Baidu for a long time, Baidu is still quite to force, but did not solve the problem, later in the Great God (forgive I do not know what the great God called) under the guidance, finally set a successful, special sharing under the setup process.

MongoDB setting up the database I will not say ... Amount: Forget, or tidy up, oneself also review again. Since I am downloading the installation package, EXE is installed directly:

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)

If there is a problem. The amount ... Cheers to discuss together. I was just touching ...

Setting up a MongoDB server as a Windows Startup service (WIN10)

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.