MongoDB configuration file under Windows configuration

Source: Internet
Author: User

MongoDB is configured and accessed through configuration files under Windows Blog Category:
    • Mongodb
    • Database
Mongomongodbwindows Configuration

MongoDB configuration file configuration:The first step: Create a new file in the "D:\Mongodb" directory, command mode, for example, create a new mongodb.conf second step: Configure the configuration items we need in mongodb.conf for specific configuration items, we can pass Bin\mongod-- The Help command determines which configuration items we need to configure to take the Key=value format in the configuration file, and key represents the options,value that needs to be configured to represent the corresponding parameters. If there is no parameter then the corresponding value is NULL for example we are configured in mongodb.conf as follows: TXT code
    1. Dbpath=d:\mongodb\data
    2. Logpath=d:\mongodb\log\mongodb.log
    3. Logappend=
    4. Journal=
    5. jsonp=
The DBPath represents the MONGODB database corresponding directory, the parameter corresponding value is D:\Mongodb\datalogpath represents the log file the file path, The value of the parameter is the value of the file path logappend the log information for MongoDB is accumulated instead of overwritten in the log file, there is no parameter value, so value is null journal for the boot log, no parameter value, So value is null JSONP represents allow HTTP access to JSONP format data, no parameter value, so value is empty to start a service with a configuration file: First step: Enter the Mongodb\bin directory DOS code first through the command line
    1. C:\Documents and Settings\chenzhou>d:
    2. D:\>CD D:\Mongodb\bin
Step Two: Start the service with the mongod-f arg command, ARG is the path that represents the configuration file because we define the configuration file in the Mongodb directory, so the ARG value is the D:\Mongodb\mongodb.confDos code
    1. D:\mongodb\bin>mongod-f D:\Mongodb\mongodb.conf
    2. All output Going To:d:\mongodb\log\mongodb.log

Configuration of log files:
First step: Specify the directory of the log files, for example, we create a new log folder in the "D:\Mongodb" directory, as the log file directory second step: Create a new log file under "D:\Mongodb\log", the file name arbitrary, For example, we define the third step of Mongodb.log: Log file configuration using the command configuration Logpath:mongod--logpath D:\Mongodb\log\ Mongodb.log is configured with a configuration file: Add Logpath=d:\mongodb\log\mongodb.log in mongodb.conf

MongoDB configuration file under Windows 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.