mongodb-Configuration Translation

Source: Internet
Author: User
Tags deprecated scalar set socket system log file permissions

configuration file (profile)
file format
Use the configuration file (using a profile)
core options (Kernel settings)
systemlog Options (System log settings)
Processmanagement Options (Process management settings)
NET Options (Network settings)
Security Options (Safety settings)
Setparameter Option (custom parameter settings)
Storage Options (Storage settings)
Operationprofiling Options (Performance Settings)
Replication Options (replica set settings)
Sharding Options (Shard settings)
Auditlog Options ()
SNMP Options ()
Text Search options (textual searching settings)
Mongos-only Options (MONGO set separately)
Windows Service Options (Windows system settings)


Configuration File

File Format

You can configure Mongod and MONGOs instances at startup using a configuration file. The configuration file contains settings that is equivalent to the Mongod and MONGOs command-line options.
Using a configuration file makes managing Mongod and MONGOs options easier, especially for large-scale deployments. You can also add comments to the configuration file to explain the server ' s settings.
If you installed from a package and has started MongoDB using your system ' s init script, you are already using a Configur ation file.

You can use the configuration file to configure Mongod and MONGOs instances at startup. The configuration file contains settings that are equivalent to the Mongod and MONGOs command-line options.
Using configuration files makes it easier to manage mongod and mongos options, especially for large-scale deployments. You can also add comments to the configuration file to explain the settings for the server.
If you are installing from a package and using the system's init script to start MongoDB, you are already using the configuration file.

File Format
IMPORTANT
Changed in version 2.6:mongodb 2.6 introduces a yaml-based configuration file format. The 2.4 configuration file format remains for backward compatibility.
MongoDB configuration files use the YAML format [1].
The following sample configuration file contains several Mongod settings that's adapt to your local configuration:
NOTE
YAML does not support tab characters for Indentation:use spaces instead.

File format
Important
2.6 Version Change: MongoDB 2.6 introduces a YAML-based configuration file format. 2.4 The configuration file format remains backwards compatible.
The MongoDB configuration file uses the YAML format [1].
The following sample configuration file contains several Mongod settings that you can adapt to your local configuration:
Attention
YAML does not support indent tabs: Use spaces.

Systemlog:   Destination: file   Path: "/var/log/mongodb/mongod.log"   Logappend: trueStorage:   Journal:      enabled: trueprocessmanagement:   Fork: trueNet:   Bindip: 127.0.0.1   Port: 27017Setparameter:   Enablelocalhostauthbypass: false...

The Linux package init scripts included in the official MongoDB packages depend on specific values for Systemlog.path, sto Rage.dbpath, and Processmanagement.fork. If you modify these settings in the default configuration file, Mongod could not start.

YAML is a superset of JSON.

The Linux package initialization scripts included in the official MongoDB package depend on the specific values of Systemlog.path,storage.dbpath and processmanagement.fork. If you modify these settings in the default configuration file, Mongod may not start.
Yaml is a superset of JSON.


Use the Configuration File

To start Mongod or mongos using a config file, specify the config file with the--config option or The-f option, as in th E following examples:
The following examples use the--config option for Mongod and MONGOs:

To start Mongod or MONGOs using a configuration file, specify the configuration file using the--config option or the-f option, as shown in the following example:
The following example uses the--config option for Mongod and MONGOs:

Mongod--config/etc/mongod.confmongos--config/etc/mongos.conf

can also

Mongod-f/etc/mongod.confmongos-f/etc/mongos.conf

Core Options systemLogOptions
systemlog:   verbosity: <int> (log component record level)    quiet: <boolean> (limit output)     Traceallexceptions: <boolean> (whether to print verbose logs for debugging)    syslogfacility: <string> (set syslog level)      path: <string> (daily operation log directory)    logappend: <boolean> (whether the log is in an additional form)     LogRotate: <string> (Log re-open)    destination: <string> (all logging addresses)    timestampformat: <string> (timestamp format)    component: (The following log operation levels are 0-5)       AccessControl: (access control)          verbosity: <int> (Logging level)       command:          Verbosity: <int> (Logging level)       storage:         verbosity: <int> (Storage logging level)          journal:            verbosity: <int>&nbsp ;     write:         verbosity: <int> (write action)  shaRding:verbosity: <int> (Shard)  replication:verbosity: <int> (copy set)  query:verbosity: <int> (enquiry)  network:verbosity: <int> (Network)  index:verbosity: <int> (Index)  geo:verbosity: <int > (geo-space)  ftdc:verbosity: <int> (diagnostic data collection)  control:verbosity: <int> (Control operation)
processManagementOptions
processmanagement :   Fork : <boolean> (background boot)   Pidfilepath : <string> (Specify a file to store process ID data)

processManagement.fork
Enable A daemon mode that runs the MONGOs or mongod process in the background. By default MONGOs or Mongod does not run as a daemon:typically you'll run MONGOs or Mongod as a daemon, either by using Processmanagement.fork or by using a controlling process, handles the daemonization process (e.g. as with upstart and SYSTEMD).
The Linux package init scripts does not expect Processmanagement.fork to change from the defaults. If you use the Linux packages and processmanagement.fork, you'll have the your own init scripts and disable th e built-in scripts.
specifies a file location to hold the process ID of the MONGOs or Mongod process, where MONGOs or Mongod will write its PID. This is useful for tracking mongos or mongod procedures that track the--fork option. Without the specified Processmanagement.pidfilepath option, the process will not create a PID file.

processManagement.pidFilePath
Specifies a file location to hold the process ID of the mongos or mongod process where mongos or mongod will write its PID. This is useful for tracking the mongos or mongod process in combination with the --fork option. Without a specified processManagement.pidFilePath option, the process creates no PID file.
指定一个文件位置来保存mongos或mongod进程的进程ID,其中mongos或mongod将会写入其PID。 这对于跟踪--fork选项的跟踪mongos或mongod过程非常有用。 没有指定的processManagement.pidFilePath选项,该进程将不创建PID文件。

netOptions
Net:   Port: <int> (instance port)   Bindip: <string> (Specify request IP)   maxincomingconnections: <int> (number of instance maximum client connections)   Wireobjectcheck: <boolean> (write operation check)   IPv6: <boolean> (whether the ip6,3.0 version is enabled is turned on by default)   Unixdomainsocket:      enabled: <boolean> (whether socket listening is enabled under UNIX system)      Pathprefix: <string> (Unix socket address)      filepermissions: <int> (set socket file permissions)   http:      enabled: <boolean> (version 3.2 deprecated)      jsonpenabled: <boolean> (version 3.2 deprecated)      restinterfaceenabled: <boolean> (version 3.2 deprecated)   SSL:      Sslonnormalports: <boolean>  (version 2.6 deprecated) whether to turn on Tsl\ssl      Mode: <string>      Pemkeyfile: <string>      Pemkeypassword: <string>      Clusterfile: <string>      Clusterpassword: <string>      Cafile: <string>      CRLFile: <string>      allowconnectionswithoutcertificates: <boolean>      allowinvalidcertificates: <boolean>      Allowinvalidhostnames: <boolean>      Disabledprotocols: <string>      Fipsmode: <boolean>   Compression:      Compressors: <string>


https://docs.mongodb.com/manual/reference/configuration-options/#use-the-configuration-file

mongodb-Configuration Translation

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.