Overview:
You can start the control instance through a configuration file when you start Mongod and MONGOs.
The configuration file contains settings equal to the Mongod and MONGOs command options.
using profiles to manage Mongod and mongos is easier, especially for large-scale deployments.
You can also add comments to the configuration file to interpret the server settings options.
To use a configuration file:
to start Mongod and MONGOs using a configuration file, specify the configuration file with the –config or-f option.
Example:
mongod–config/etc/mongod.conf//–config can be replaced with-f
mongos–config/etc/mongos.conf
File format:
mongodb configuration file uses Yaml format.
Note: Yaml does not accept tab, use a space instead.
official Address description: Click to jump.
#此处为配置文件可配置的内容 #mongod config file #MongoDB configuration files use the yaml format. #The following example configuration file contains several mongod settings.######## #Example start######## #systemLog: # destination : file# path: "/var/log/mongodb/mongodb.log" # logappend: true #storage: # journal:# enabled: true#processmanagement: # fork: true#net:# bindip: 127.0.0.1# port: 27017#setparameter:# enablelocalhostauthbypass: false######## #Example end########## ###### #Core OptionssystemLog:# verbosity: 0 #Default: 0 ; 1 to 5 increases the verbosity level to include debug messages.# quiet: <boolean># traceallexception: <boolean># syslogFacility: user path: "/usr/local/mongodb/log/mongod.log" logAppend: true# logRotate: <string> #rename or reopen destination: file# timeStampFormat: iso8601-local# component:# accesscontrol:# verbosity: 0# command:# verbosity: 0# # comment additional component verbosity settings omitted for brevity# storage:# verbosity: 0# &nbsP; journal:# verbosity : <int># write:# verbosity: 0######### #ProcessManagement OptionsprocessManagement: fork: true pidfilepath: "/usr/local/mongodb/log/mongod.pid" ########## #Net optionsnet: port: 27017# bindip: <string> # default all interfaces.# maxincomingconnections: 65536# wireobjectcheck: true# ipv6: false# unixdomainsocket:# enabled: true# pathPrefix: "/tmp" # filePermissions: 0700# http:# enabled: false# jsonpenabled: false# Restinterfaceenabled: false# ssl:# sslonnormalports: <boolean> # deprecated since 2.6# mode: <string># pemkeyfile: <string># pemkeypassword: <string># clusterfile: <string># clusterPassword: <string># CAFile: <string># CRLFile: < string># allowconnectionswithoutcertificates: <boolean># allowInvalidCertificates: <boolean># allowinvalidhostnames: false# fipsmode: <boolean>######### #security options#security:# keyFile: <string># clusterAuthMode: keyFile# authorization: disable# javascriptenabled: true####### #security. SASL Options# sasl:# hostName: <string># serviceName: <string># saslauthdsocketpath: <string>########## #setParameter OptionsetParameter: enablelocalhostauthbypass: false# <parameter1>: <value1># <parameter2>: <value2>########## #storage optionsstorage: dbpath: "/data/db" # indexbuildretry: true# repairpath: "/data/db/_ TMP "# journal:# enabled: true# directoryperdb: false# syncPeriodSecs: 60 engine: "Mmapv1" #Valid options include mmapv1 and wiredtiger.######## #storage. mmapv1 options# mmapv1:# preallocdatafiles: true# nssize: 16# quota:# enforced: false# maxfilesperdb: 8# smallFiles: false# journal:# debugFlags: <int># commitintervalms: 100 # 100 or 30######## #storage. WiredTiger options# wiredtiger:# engineconfig:# cacheSizeGB: <number> #Default: the maximum of half of physical RAM or 1 gigabyte# statisticslogdelaysecs: 0# journalcompressor: " Snappy "# directoryforindexes: false# collectionConfig:# blockcompressor: "Snappy" # indexconfig:# prefixcompression: true########### #operationProfiling options# operationprofiling:# slowopthresholdms: 100# mode: "Off" ########## # #replication &NBSP;OPTIONS#REPLICATION:#&NBSP;&NBsp; oplogsizemb: <int># replsetname: <string># secondaryindexprefetch: all########### #sharding options#sharding:# clusterrole: <string> #configsvr or shardsvr# archivemovedchunks: true########## #auditLog Options#auditLog:# destination: <string> #syslog/console/file# format: <string> #JSON/bson# path: <string># filter: <string>#### ###### #snmp options#snmp:# subagent: <boolean># master: <boolean>######### #mongos-ONLY&NBSP;OPTIONS#REPLICATION:#&NBSP;&NBSP;&NBSP;LOCALPINGTHRESHOLDMS: 15# #sharding: # autosplit: true# configdb: <string># chunksize: 64######## # #Windows Service Options#processManagement:# windowsService:# serviceName: <string># displayName: < string># description: <string># serviceuser: <string># servicepassword: <string >
This article is from the "you insist on _it blog" blog, please be sure to keep this source http://fdgui.blog.51cto.com/3484207/1682555
About the "MongoDB" 3.0 configuration file