When MongoDB is installed and configured for WINDOWS Services, version 1.x. x does not have serviceName. solution 1. x. xservicename

Source: Internet
Author: User
Tags create mongodb

When MongoDB is installed and configured for WINDOWS Services, version 1.x. x does not have serviceName. solution 1. x. xservicename

Let's talk about the problems and solutions encountered during mongodb installation. If you encounter the same problems, you can make a reference.

I installed version 1.3.5 (later I tried 1.4.2)

An ERROR occurred while configuring the Windows service. Print ERROR: unknown option serviceName. Then, the MongoDB option cannot be found in the service. If you execute net start MongoDB, you cannot execute it.

Finally, the correct installation and configuration methods are found in the official documentation (Pay attention to the installation of msi on the official website. You need to download msi. My website is zip.)

I. Version Download

This is not much to be said. The address is given for each requirement.

Ii. Installation

1. decompress the zip file directly to the root directory of the D Drive and change the folder name to mongodb (this name is random ). In this case, the main folder is the \ bin folder, which contains several exe files and the important ones are:

Server  mongod.exeRouter  mongos.exeClient  mongo.exe

2,What you need to do is, Create a new data folder under D: \ mongodb, a new log and db folder under data, and a new file named mongo under log. log. In short, you have to create a place to store data and a place to store logs.

D: \ mongodb \ data \ db

D: \ mongodb \ data \ log \ mongo. log

3. Create mongo. config under D: \ mongodb and copy the following two lines:

logpath= D:mongodb\data\log\mongo.logdbpath= D:mongodb\data\db

4. Everything is ready. Open the cmd console as the administrator (do not know how to open Baidu), go to the D: \ mongodb \ bin \ path, and enter:

sc.exe create MongoDB binPath= "\"D:\mongodb\bin\mongod.exe\" --service --config=\"D:\mongodb\mongo.config\"" DisplayName= "MongoDB" start= "auto"

If everything goes well, the console prints [SC]: CreateService succeeded. If it fails, check the path and check whether the path in the configuration file is correct.

5. Start

Two methods:

(1) Enter

Net start MongoDB (Enabled) net stop MongoDB (disabled)

(2) Enter services. msc in the console, open the service, find MongoDB, and click Start, and set automatic. It will be automatically started next time.

Iii. Uninstall

Enter SC delete MongoDB in the console.

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.