MongoDB Learning: (a) MongoDB installation

Source: Internet
Author: User
Tags log log

MongoDB Learning: (a) MongoDB installation
MongoDB Introduction:     The Direct encyclopedia:


MongoDB Installation: 1: Download the installation:MongoDB Installation: Https://www.mongodb.com/download-center#community
The installation files under Windows are direct installation files with the. msi suffix, installed directly after download, and the installation path is optional.
"Mongodb-win32-x86_64-enterprise-windows-64-3.2.8-signed.msi" is installed here.

Install option Select "Custom" to select the installation path, complete is installed by default to C drive

2: ConfigurationAfter the installation is complete, copy the installation path: D:\MongoDB\Server\3.2\bin (the path is my installation path) to open the CMD Command window and enter the following command: >d: (This command applies to the other partition disk you loaded, here is the D drive) >CD d:\ Mongodb\server\3.2\bin>mongod.exe--install--logpath "D:\MongoDB\log\log.txt"--dbpath" D:\MongoDB\data\db "(please first follow the path to build folders and files, otherwise error, there are hints)>net Start MongoDB

parameter Description:DBPath: A data file storage path in which each database creates a subdirectory that prevents mongod.lock that are run multiple times on the same instance from being saved in this directory. LogPath: Error log file. Logappend: Error log with append no mode (default is overwrite mode). BIND_IP: The binding IP of the external service, which is generally set to null, and is bound to the available IP on this machine, and can be specified separately if necessary. PORT: External service port, Web management port on the basis of this port +1000.fork: After the daemon form to run the service. Journal: Turn on the log function, save the operation log to reduce the recovery time of single machine failure, after the 1.8 version formally joined, replace in 1.7.5 version of the Dur parameter. Syncdelay: The time of the system to flush the disk synchronously, in seconds, the default is 60 seconds. DIRECTORYPERDB: Each db is stored in a separate directory, it is recommended to set this parameter. Maxconns: Maximum number of connections. Repairpath: temporary directory when executing repair. If the journal is not turned on, the repair operation must be performed after the exception is restarted after the shutdown.
remark:The MongoDB default database folder path is c:/data/db (note: Although it is the default, you need to create it yourself). However, you can also set the default path yourself, such as d:/test/data/db. You must create a storage folder for the database files before you start the MongoDB service, or you cannot start successfully. When using the system default folder path, the start service does not need to add the--dbpath parameter description. If it is not the default path, the Startup service format has the following two types: (1) Mongod--dbpath the path to be stored. such as: Mongod--dbpath d:\test\data "NOTE: The path cannot contain spaces, otherwise use the 2nd" (2) mongod--dbpath "stored path". such as Mongod--dbpath "D:\My text\data"

3: Start service and stop serviceAfter configuring the DB folder and the log log file, the Execute Start command is: >net start mongodb>net stop MongoDB (Online said net end MongoDB, I test the error, there may be different version)


After successful startup, you can view the address in the browser: localhost:27017

Problem Solving:Service- specific error: 100 service-specific error occurred:
Workaround:Method 1: Remove the installation pathmongodb\data\mongod.lock file (my error path, without this file)Method 2: Delete the servicemongod--logpath "D:\Program files\mongodb\data\logs.txt"--logappend--dbpath "D:\Program files\mongodb\data"-- Directoryperdb--servicename "MongoDB"--servicedisplayname "MongoDB"--remove

re-registering the servicemongod--logpath "D:\Program files\mongodb\data\logs.txt"--logappend--dbpath "D:\Program files\mongodb\data"-- ServiceName "MongoDB"--servicedisplayname "MongoDB"--install

at this end, our MongoDB is officially installed and started. The next chapter will introduce the basic additions and deletions to the Operation



From for notes (Wiz)

MongoDB Learning: (a) MongoDB installation

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.