Configuration File Settings and Command-Line Options Mapping配置文件设置和命令行选项映射

The following table maps the configuration file settings and the related mongod and mongos command-line options.下表映射了配置文件设置以及相关的mongodmongos命令行选项。

Configuration File Setting配置文件设置mongod and mongos Command-Line Options命令行选项
auditLog.auditEncryptionKeyIdentifiermongod --auditEncryptionKeyUID
mongos --auditEncryptionKeyUID
auditLog.compressionModemongod --auditCompressionMode
mongos --auditCompressionMode
auditLog.destinationmongod --auditDestination
mongos --auditDestination
auditLog.filtermongod --auditFilter
mongos --auditFilter
auditLog.formatmongod --auditFormat
mongos --auditFormat
auditLog.localAuditKeyFilemongod --auditLocalKeyFile
mongos --auditLocalKeyFile
auditLog.pathmongod --auditPath
mongos --auditPath
cloud.monitoring.free.statemongod --enableFreeMonitoring
cloud.monitoring.free.tagsmongod --freeMonitoringTag
net.bindIpmongod --bind_ip
mongos --bind_ip
net.bindIpAllmongod --bind_ip_all
mongos --bind_ip_all
net.compression.compressorsmongod --networkMessageCompressors
mongos --networkMessageCompressors
net.ipv6mongod --ipv6
mongos --ipv6
net.maxIncomingConnectionsmongod --maxConns
mongos --maxConns
net.portmongod --port
mongos --port
net.tls.allowConnectionsWithoutCertificatesmongod --tlsAllowConnectionsWithoutCertificates
mongos --tlsAllowConnectionsWithoutCertificates
net.tls.allowInvalidCertificatesmongod --tlsAllowInvalidCertificates
mongos --tlsAllowInvalidCertificates
net.tls.allowInvalidHostnamesmongod --tlsAllowInvalidHostnames
mongos --tlsAllowInvalidHostnames
net.tls.CAFilemongod --tlsCAFile
mongos --tlsCAFile
net.tls.clusterCAFilemongod --tlsClusterCAFile
mongos --tlsClusterCAFile
net.tls.certificateSelectormongod --tlsCertificateSelector
mongos --tlsCertificateSelector
net.tls.clusterCertificateSelectormongod --tlsClusterCertificateSelector
mongos --tlsClusterCertificateSelector
net.tls.clusterFilemongod --tlsClusterFile
mongos --tlsClusterFile
net.tls.clusterPasswordmongod --tlsClusterPassword
mongos --tlsClusterPassword
net.tls.CRLFilemongod --tlsCRLFile
mongos --tlsCRLFile
net.tls.disabledProtocolsmongod --tlsDisabledProtocols
mongos --tlsDisabledProtocols
net.tls.FIPSModemongod --tlsFIPSMode
mongos --tlsFIPSMode
net.tls.modemongod --tlsMode
mongos --tlsMode
net.tls.certificateKeyFilemongod --tlsCertificateKeyFile
mongos --tlsCertificateKeyFile
net.tls.certificateKeyFilePasswordmongod --tlsCertificateKeyFilePassword
mongos --tlsCertificateKeyFilePassword
net.ssl.sslOnNormalPortsmongod --sslOnNormalPorts
mongos --sslOnNormalPorts
net.unixDomainSocket.enabledmongod --nounixsocket
mongos --nounixsocket
net.unixDomainSocket.filePermissionsmongod --filePermissions
mongos --filePermissions
net.unixDomainSocket.pathPrefixmongod --unixSocketPrefix
mongos --unixSocketPrefix
net.wireObjectCheck
operationProfiling.modemongod --profile
operationProfiling.slowOpSampleRatemongod --slowOpSampleRate
mongos --slowOpSampleRate
operationProfiling.slowOpThresholdMsmongod --slowms
mongos --slowms
processManagement.forkmongod --fork
mongos --fork
processManagement.pidFilePathmongod --pidfilepath
mongos --pidfilepath
processManagement.timeZoneInfomongod --timeZoneInfo
mongos --timeZoneInfo
processManagement.windowsService.descriptionmongod.exe --serviceDescription
mongos.exe --serviceDescription
processManagement.windowsService.displayNamemongod.exe --serviceDisplayName
mongos.exe --serviceDisplayName
processManagement.windowsService.serviceNamemongod.exe --serviceName
mongos.exe --serviceName
processManagement.windowsService.servicePasswordmongod.exe --servicePassword
mongos.exe --servicePassword
processManagement.windowsService.serviceUsermongod.exe --serviceUser
mongos.exe --serviceUser
replication.enableMajorityReadConcernmongod --enableMajorityReadConcern
replication.localPingThresholdMsmongos --localThreshold
replication.oplogSizeMBmongod --oplogSize
replication.replSetNamemongod --replSet
security.authorizationmongod --auth
mongod --noauth
security.clusterAuthModemongod --clusterAuthMode
mongos --clusterAuthMode
security.enableEncryptionmongod --enableEncryption
security.encryptionCipherModemongod --encryptionCipherMode
security.encryptionKeyFilemongod --encryptionKeyFile
security.javascriptEnabledmongod --noscripting
mongos --noscripting
security.keyFilemongod --keyFile
mongos --keyFile
security.kmip.clientCertificateFilemongod --kmipClientCertificateFile
security.kmip.clientCertificatePasswordmongod --kmipClientCertificatePassword
security.kmip.clientCertificateSelectormongod --kmipClientCertificateSelector
security.kmip.connectRetriesmongod --kmipConnectRetries
security.kmip.connectTimeoutMSmongod --kmipConnectTimeoutMS
security.kmip.keyIdentifiermongod --kmipKeyIdentifier
security.kmip.portmongod --kmipPort
security.kmip.rotateMasterKeymongod --kmipRotateMasterKey
security.kmip.serverCAFilemongod --kmipServerCAFile
security.kmip.serverNamemongod --kmipServerName
security.kmip.activateKeysmongod --kmipActivateKeys
security.kmip.keyStatePollingSecondsmongod --kmipKeyStatePollingSeconds
security.ldap.authz.queryTemplatemongod --ldapAuthzQueryTemplate
security.ldap.bind.methodmongod --ldapBindMethod
mongos --ldapBindMethod
security.ldap.bind.queryPasswordmongod --ldapQueryPassword
mongos --ldapQueryPassword
security.ldap.bind.queryUsermongod --ldapQueryUser
mongos --ldapQueryUser
security.ldap.bind.saslMechanismsmongod --ldapBindSaslMechanisms
mongos --ldapBindSaslMechanisms
security.ldap.bind.useOSDefaultsmongod --ldapBindWithOSDefaults
mongos --ldapBindWithOSDefaults
security.ldap.serversmongod --ldapServers
mongos --ldapServers
security.ldap.timeoutMSmongod --ldapTimeoutMS
mongos --ldapTimeoutMS
security.ldap.transportSecuritymongod --ldapTransportSecurity
mongos --ldapTransportSecurity
security.ldap.userToDNMappingmongod --ldapUserToDNMapping
mongos --ldapUserToDNMapping
security.redactClientLogDatamongod --redactClientLogData
mongos --redactClientLogData
security.sasl.hostNamemongod --setParameter saslHostName=...
mongos --setParameter saslHostName=...
security.sasl.saslauthdSocketPathmongod --setParameter saslauthdPath=...
mongos --setParameter saslauthdPath=...
security.sasl.serviceNamemongod --setParameter saslServiceName=...
mongos --setParameter saslServiceName=...
security.transitionToAuthmongod --transitionToAuth
mongos --transitionToAuth
setParametermongod --setParameter
mongos --setParameter
sharding.archiveMovedChunksmongod --moveParanoia
mongod --noMoveParanoia
sharding.clusterRolemongod --shardsvr
mongod --configsvr
sharding.configDBmongos --configdb
snmp.disabledmongod --snmp-disabled
snmp.mastermongod --snmp-master
snmp.subagentmongod --snmp-subagent
storage.dbPathmongod --dbpath
storage.directoryPerDBmongod --directoryperdb
storage.enginemongod --storageEngine
storage.inMemory.engineConfig.inMemorySizeGBmongod --inMemorySizeGB
storage.journal.commitIntervalMsmongod --journalCommitInterval
storage.journal.enabledmongod --journal
mongod --nojournal
storage.syncPeriodSecsmongod --syncdelay
storage.wiredTiger.collectionConfig.blockCompressormongod --wiredTigerCollectionBlockCompressor
storage.wiredTiger.engineConfig.cacheSizeGBmongod --wiredTigerCacheSizeGB
storage.wiredTiger.engineConfig.directoryForIndexesmongod --wiredTigerDirectoryForIndexes
storage.wiredTiger.engineConfig.journalCompressormongod --wiredTigerJournalCompressor
storage.wiredTiger.indexConfig.prefixCompressionmongod --wiredTigerIndexPrefixCompression
systemLog.component.accessControl.verbositymongod --setParameter "logComponentVerbosity={accessControl: ... }"
mongos --setParameter "logComponentVerbosity={accessControl: ... }"
systemLog.component.command.verbositymongod --setParameter "logComponentVerbosity={command: ... }"
mongos --setParameter "logComponentVerbosity={command: ... }"
systemLog.component.control.verbositymongod --setParameter "logComponentVerbosity={control: ... }"
mongos --setParameter "logComponentVerbosity={control: ... }"
systemLog.component.ftdc.verbositymongod --setParameter "logComponentVerbosity={ftdc: ... }"
mongos --setParameter "logComponentVerbosity={ftdc: ... }"
systemLog.component.geo.verbositymongod --setParameter "logComponentVerbosity={geo: ... }"
mongos --setParameter "logComponentVerbosity={geo: ... }"
systemLog.component.index.verbositymongod --setParameter "logComponentVerbosity={index: ... }"
mongos --setParameter "logComponentVerbosity={index: ... }"
systemLog.component.network.verbositymongod --setParameter "logComponentVerbosity={network: ... }"
mongos --setParameter "logComponentVerbosity={network: ... }"
systemLog.component.query.verbositymongod --setParameter "logComponentVerbosity={query: ... }"
mongos --setParameter "logComponentVerbosity={query: ... }"
systemLog.component.replication.heartbeats.verbositymongod --setParameter "logComponentVerbosity={replication: {heartbeats: ... }}"
mongos --setParameter "logComponentVerbosity={replication: {heartbeats: ... }}"
systemLog.component.replication.rollback.verbositymongod --setParameter "logComponentVerbosity={replication: {rollback: ... }}"
mongos --setParameter "logComponentVerbosity={replication: {rollback: ... }}"
systemLog.component.replication.verbositymongod --setParameter "logComponentVerbosity={replication: ... }"
mongos --setParameter "logComponentVerbosity={replication: ... }"
systemLog.component.sharding.verbositymongod --setParameter "logComponentVerbosity={sharding: ... }"
mongos --setParameter "logComponentVerbosity={sharding: ... }"
systemLog.component.storage.journal.verbositymongod --setParameter "logComponentVerbosity={storage: {journal: ... }}"
mongos --setParameter "logComponentVerbosity={storage: {journal: ... }}"
systemLog.component.storage.recovery.verbositymongod --setParameter "logComponentVerbosity={storage: {recovery: ... }}"
mongos --setParameter "logComponentVerbosity={storage: {recovery: ... }}"
systemLog.component.storage.verbositymongod --setParameter "logComponentVerbosity={storage: ... }"
mongos --setParameter "logComponentVerbosity={storage: ... }"
systemLog.component.write.verbositymongod --setParameter "logComponentVerbosity={write: ... }"
mongos --setParameter "logComponentVerbosity={write: ... }"
systemLog.destinationmongod --logpath
mongos --logpath
mongod --syslog
mongos --syslog
systemLog.logAppendmongod --logappend
mongos --logappend
systemLog.logRotatemongod --logRotate
mongos --logRotate
systemLog.pathmongod --logpath
mongos --logpath
systemLog.quietmongod --quiet
mongos --quiet
systemLog.syslogFacilitymongod --syslogFacility
mongos --syslogFacility
systemLog.timeStampFormatmongod --timeStampFormat
mongos --timeStampFormat
systemLog.traceAllExceptionsmongod --traceExceptions
systemLog.verbositymongod --verbose
mongos --verbose

ChangeLog

Starting in version 5.0:从5.0版开始:
MongoDB removes the --serviceExecutor command-line option and the corresponding net.serviceExecutor configuration option.MongoDB删除--serviceExecutor命令行选项和相应的net.serviceExecutor配置选项。
Starting in version 4.4:从4.4版开始:
MongoDB removes the --noIndexBuildRetry command-line option and the corresponding storage.indexBuildRetry option.MongoDB删除了--noIndexBuilderRetry命令行选项和相应的storage.indexBuildRetry选项。
Starting in version 4.2:从4.2版开始:

MongoDB removes the deprecated MMAPv1 storage engine and the MMAPv1-specific configuration options:MongoDB删除了不推荐使用的MMAPv1存储引擎和特定于MMAPv1的配置选项:

Removed Configuration File Setting删除了配置文件设置Removed Command-line Option删除了命令行选项
storage.mmapv1.journal.commitIntervalMs
storage.mmapv1.journal.debugFlagsmongod --journalOptions
storage.mmapv1.nsSizemongod --nssize
storage.mmapv1.preallocDataFilesmongod --noprealloc
storage.mmapv1.quota.enforcedmongod --quota
storage.mmapv1.quota.maxFilesPerDBmongod --quotaFiles
storage.mmapv1.smallFilesmongod --smallfiles
storage.repairPathmongod --repairpath
replication.secondaryIndexPrefetchmongod --replIndexPrefetch

For earlier versions of MongoDB, refer to the corresponding version of the manual. 有关MongoDB的早期版本,请参阅相应版本的手册。For example:例如:

←  Convert Command-Line Options to YAMLMongoDB Server Parameters →