MongoDB starts and registers the service through the configuration file

Source: Internet
Author: User

1. Configure the MONGODB environment variable, after the configuration is completed, you can directly execute Mong, mongod and other common commands, not every time to the MongoDB installation directory bin down execution;

2. Start the MONGO service by command

Mongod--dbpath = D:\mongodb\data\db--logpath = D:\mongodb\data\log\mongod.log

3. Each time through the command to start mongod too troublesome, then register system services

Mongod--install --dbpath = D:\mongodb\data\db--logpath = D:\mongodb\data\log\mongod.log

Once the registration is complete, you can find the MongoDB service in the system service, so you don't have to start the service with the command line every time.

4. Start the MONGO service through the configuration file, the configuration file needs to be created by itself, only need to develop your own configuration file path after-F

Mongod-f D:\mongodb\conf\mongo.conf

Configuration file content as follows, you can add or modify the configuration file according to your own needs

DBPath ==true27017

5. The configuration file registration service is similar to the direct development of DBPath and LogPath, except that the parameter information is in the configuration file

Mongod--install -F D:\mongodb\conf\mongo.conf

The net start and net stop command can be used to start or stop the MONGO service after the service registration is complete, which is not much easier

MongoDB starts and registers the service through the configuration file

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.