MongoDB Environment Configuration and service start-up

Source: Internet
Author: User

1. Configuration of environment variables

(1). System variables, environment variables, advanced system settings, computer properties, high-level systems variable->path-> new--Input MongoDB installation file path + Bin

A. For example C: \ System file \mongodb\bin

(2). Create a new DB file and configuration file

A. Create a new data file in the bin file sibling

New db file under B.data file

(3). Create a new database log

A. Create a new logs file in the bin file sibling

New Mongodb.log under B.logs file

(4). Create a startup configuration file

A. Create a new mongodb.cfg at the bin peer

The b.mongodb.cfg is written as follows:

1). Systemlog:

A.destination:file

B.path:mongodb file path +bin\logs\mongodb.log

2). Storage:

A.dbpath:mongodb file path \data\db

(5). Connection Port number 27017

1) win+r input cmd Enter

2) Enter file path +bin\mongod.exe--dbpath file path +data\db

3) 27017 default port-------------do not close cmd

4) Another open cmd run

5) Enter the file path +bin\mongo.exe-----------------The connection is successful at this time

6) Close all cmd

7) Open cmd as Administrator

A. File path +bin\mongod.exe--config file path +mongodb.cfg--install

Create a new file under the logs file

8) Administrator status cmd input net start MongoDB (Service Mount window)-------Server name cannot be written incorrectly

Administrator status cmd input net stop MongoDB shutdown service

10) If the startup error

Delete the Mongodb.lock file from the db file under the data file

MongoDB Environment Configuration and service start-up

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.