MongoDB (4)-start of MongoDB Service

Source: Internet
Author: User
Document directory
  • Original Method
  • Configuration file Method
  • Daemon Method
Original Method

The MongoDB function can be used only when the MongoDB service is started. Normally, a command window is opened and the following command is entered to start the service:

Configuration file Method

If you do not want to enter a lot of complex parameters in the command line during each startup, you can save the parameter information in the configuration file. Create a configuration file named MongoDB. CnF in the same directory as those gadgets. The content of the file is as follows:

Dbpath = "D: \ database \ MongoDB \ data"

Then, enter the following command in the Command window to start the service.

It seems similar to the above method. You still need to specify the configuration file. However, if the parameter is more than-dbpath, you can write the parameters in the configuration file, it is much more convenient to call the command line.

Daemon Method

To start a service in the two methods described above, you must open a command line window. If the window is closed, the service will be stopped. We can use the -- fork parameter to run MongoDB services in the background, which is relatively safe. The -- fork parameter is used with the -- logpath parameter.

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.