[MongoDB] Configure a Windows Service for MongoDB, mongodbconfigure

Source: Internet
Author: User
Tags echo command

[MongoDB] Configure a Windows Service for MongoDB, mongodbconfigure

In this blog, I will mainly attach great importantance to how to create a windows service for mongodb. The method described in the next is referred from the official website of mongodb.

Http://docs.mongodb.org/manual/tutorial/install-mongodb-on-windows/


  • First of all, create the folder and files that need to store db and log. if you forgot, you cocould view the above blog. In my local machine,


  • Create a configuration file
Create a configuration file, this file can include any of the configuration options for example D, but must include a valid setting for logpath. we can learn from the next picture that echo command promart.

  • Create the mongodb service. use the following command. and use command 'net start mongodb 'to start the service.


In the meantime, we cocould use anther way to start service.


  • Use the command {net stop mongoDB} to stop this server or in the above service window.


Installing MongoDB as a Windows service fails under Windows 7.

I have also encountered this problem. Run cmd as an administrator and then execute the above command.
 
How can I configure a MongoDB database on Linux as the master database? In Windows, MongoDB is a slave database?

Use the master parameter when starting mongodb on Linux, and use the slave parameter when starting on windows.
However, we recommend that you use the replica set later than 2.4 in the official documentation. Do not use master-slave replication any more.
Using replica set requires more than three nodes. You can set two or more data nodes and multiple election nodes. If the number of nodes is a base node, the system determines which node should be primary.
I have not tried to enable mongodb on both Linux and windows.
For the parameters for enabling mongodb, refer to here:
Docs.mongodb.org/..tions/
For master-slave replication information, refer to here:

Docs.mongodb.org/manual/core/master-slave/

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.