MongoDB is configured and accessed through the configuration file in Windows

Source: Internet
Author: User
MongoDB configuration file Configuration:Step 1: create a file in the "D: \ MongoDB" directory. The command method is not limited. For example, create a MongoDB. step 2 of conf: In MongoDB. in Conf, configure the required configuration items. For specific configuration items, we can use the bin \ mongod -- Help Command to determine the configuration items we need to configure. In the configuration file, the key = value format is used, key indicates the options to be configured, and value indicates the corresponding parameter. If no parameter exists, the corresponding value is null. For example, in MongoDB. the configuration in conf is as follows: TXT code
  1. Dbpath = D: \ MongoDB \ data
  2. Logpath = D: \ MongoDB \ log \ MongoDB. Log
  3. Logappend =
  4. Journal =
  5. Jsonp =
Description: dbpath indicates the directory corresponding to the MongoDB database. The parameter value D: \ MongoDB \ datalogpath indicates the file path of the log file, the parameter value is the file path value. logappend indicates that the MongoDB log information is accumulated in the log file rather than overwritten. There is no parameter value. Therefore, if the value is empty journal, it indicates that the startup log has no parameter value, therefore, if the value is empty, jsonp indicates that the jsonp format data can be accessed through HTTP. No parameter value exists, so the value is empty. Start the service through the configuration file: Step 1: first enter the DOS code of the MongoDB \ bin directory through the command line
  1. C: \ Documents ents and Settings \ Chenzhou> D:
  2. D: \> Cd D: \ MongoDB \ bin
Step 2: run the mongod-F Arg command to start the service. Arg indicates the path of the configuration file. Because we define the configuration file under the MongoDB directory, the ARG value is D: \ MongoDB. confdos code
  1. D: \ MongoDB \ bin> mongod-f d: \ MongoDB. conf
  2. All output going to: D: \ MongoDB \ log \ MongoDB. Log

Log File Configuration:
Step 1: first specify the directory of the log file. For example, create a log folder under the "D: \ MongoDB" directory and store the log file as the directory. Step 2: create a new log file under \ MongoDB \ log. The file name is arbitrary. For example, we define it as MongoDB. step 3: configure the log file by using the command to configure logpath: mongod -- logpath D: \ MongoDB \ log \ MongoDB. log is configured using the configuration file: In MongoDB. add logpath = D: \ MongoDB \ log \ MongoDB in Conf. log transferred from: http://chenzhou123520.iteye.com/blog/1582194
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.