MongoDB Fundamentals Article 1: Installation and service configuration

Source: Internet
Author: User
Tags install mongodb

First, downloadPlease go to the official website to download community version MongoDB, I currently see the latest version is 3.6.4https://www.mongodb.com/download-center#community if you want to download the historical version, Go to the historical repository Https://www.mongodb.org/dl/win32/x86_64-2008plus-ssl Second, installation1, MSI installation: Fool installation, mode Select Custom, modify the file installation directory: D:\Program Files\mongodb\server do not have to install MongoDB Compress 2, compressed package: Unzip the compressed file directly, throw it to the d:\ Program Files\mongodb\server\ under my Mongodb-win32-x86_64-3.4.13.zip, decompression to D:\Program files\mongodb\server\3.4 third, local environment variablesCreate a bad environment variable mongodb_home, with a value of D:\Program files\mongodb\server\3.4 added to the last side of the path context variable;%mongodb_home%\bin Note: This is the reason to configure the environment variables for later execution of MONGO and Mongod commands more convenient, and switch version, only need to modify the environment variables, or each time to navigate to the bin directory, too Tired heart Iv. Service ConfigurationCreate a directory for storing data and logs D:\mongodb\3.4\data\dbd:\mongodb\3.4\data\log initializes the service in two ways: method One: Create config file and perform fame 1, Create a Mongo.config file (recommended in the sibling directory of the MongoDB bin file), add the following parameter
# # Specifies the database directory dbpath=d:\mongodb\3.4\data\db## the specified log file logpath=d:\mongodb\3.4\data\log\mongod.log## writes the log using the Append method logappend =true## bind service IP, default is 127.0.0.1bind_ip=0.0.0.0## service port number, default is 27017port=27017

2. Execute under CMD as administrator (Note that the config parameter is best wrapped in quotation marks, otherwise there will be a space in the path to fail):

Mongod--config "D:\Program files\mongodb\server\3.4\mongo.config"--servicename= "MongoDB 3.4"--servicedisplayname= "MongoDB 3.4"--install Note: ServiceName: The app's service name, which can be removed as a unique flag servicedisplayname: The display name of the service in the Windows app, if you do not specify this parameter, The default display MongoDB method two: Directly in the command statement input parameters with the administrator to execute this parameter with the command: Mongod--dbpath=d:\mongodb\3.4\data\db--logpath=d:\mongodb\3.4 \data\log\mongod.log--bind_ip=0.0.0.0--port=27017--servicename= "MongoDB 3.4"--servicedisplayname= "MongoDB 3.4"-- Install Remove Service method execute the following command as an administrator: Mongod--remove--servicename "MongoDB 3.4" v. Start service execution command: net start "MongoDB 3.4" Tip: Close the service command: net stop "MongoDB 3.4" six, login debugging cmd, enter MONGO, return, see the following interface, indicating the successful installation

MongoDB Fundamentals Article 1: Installation and service configuration

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.