MongoDB Install Windows Services

Source: Internet
Author: User

It is inconvenient to start MongoDB every time you run Mongod--dbpath d:/mongodb/data command line, just like I don't install MySQL, I want to use it as a Windows service, so it's much easier.

D:\mongodb\bin>mongod--logpath D:\MongoDB\logs\MongoDB.log--logappend--dbpath D:\MongoDB\data--directoryperdb --servicename MongoDB--install
All output Going To:d:\mongodb\logs\mongodb.log
Creating service MongoDB.
Service creation successful.
Service can is started from the command line via ' net start ' MongoDB '.

Note: This command to the MongoDB Bin directory to run, at the beginning, I was directly under the D:\ run, the results of the service executable directory is "" D:\mongod "--logpath" D:\MongoDB\logs\MongoDB.log "-- Logappend--dbpath "D:\MongoDB\data"--directoryperdb--service ", certainly is wrong.

The command line specifies the log file: D:\MongoDB\logs\MongoDB.log, the log is output in an append manner;

Data file directory: D:\MongoDB\data, and the parameter--directoryperdb indicates that each DB will create a new directory;

Name of the Windows service: MongoDB;

The above three parameters can be based on their own circumstances, hehe.

Finally, the installation parameters:--install, the opposite is--remove

Start Mongodb:net start MongoDB


Stop Mongodb:net Stop MongoDB

MongoDB Install Windows Services

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.