MongoDB Installation and Windows service startup

Source: Internet
Author: User

1. Download and install

Download Path Login Official website: http://www.mongodb.org/downloads

2. Create a new directory

My path is D:\MongoDB.

The new directory structure under the MongoDB file is:

--MongoDB

--Bin

--Data
--DB

--Log

--MongoDB.log

3. Start

Each time you start MongoDB, it will run:

$ CD D:\MongoDB\bin

$ mongod-dbpath "D:\MongoDB\data\db"

4. Server Startup

$ d:\mongodb\bin>mongod--dbpath "D:\MongoDB\data\db"--logpath "D:\MongoDB\data\log\MongoDB.log"--install-- ServiceName "MongoDB"

MongoDB.log is the log file that was started, serviceName the "MongoDB" service named MongoDB.

Start the MongoDB service (only need to run at a later time):

$ d:\mongodb\bin>net Start MongoDB

Then open Task Manager and you can see that the MONGODB process has started.

To close a service and delete a process:

$ d:\mongodb\bin>net Stop MongoDB (shutdown service)

$ d:\mongodb\bin>mongod--dbpath "D:\MongoDB\data\db"--logpath "D:\MongoDB\data\log\MongoDB.log"--remove-- ServiceName "MongoDB"

  

MongoDB Installation and Windows service startup

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.