配置文件
MongoDB常用配置参数可以由config配置文件统一设置实现。Mongod的配置文件是mongod…yaml,Mongos的配置文件为mongos.yaml。MongoDB在2.6版本开始,配置文件
采用YAML格式。在使用配置文件前,先需要手工建立YAML配置文件内容,配置文件详细内容可以参考后续网络配置、存储配置内容。
配置文件模块
net:
systemLog:
storage:
processManagement:
security:
operationProfiling:
replication:
sharding:
setParameter:
auditLog:
snmp:
网络模块
net:
prot: <int>
bindIp: <string>
maxIncomingConnections: <int>
wireObjectCheck: <boolean>
ipv6: <bool>
http:
enabled: <boolean>
JSONEnabled: <boolean>
RESTInterfaceEnabled: <boolean>
ssl:
sslOnNormalPorts: <boolean>
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>
日志模块
systemLog:
verbosity: <int>
quiet: <bool>
traceAllExceptions: <bool>
syslogFacility: <string>
path: <string>
logAppend: <bool>
logRotate: rename|reopen
destination: <string>
timeStampFormat: <string>
component:
accessControl:
verbosity: <int>
command:
verbosity: <int>
存储引擎模块
storage:
dbPath: <string>
indexBuildRetry: <bool>
repairPath: <string>
journal:
enabled: <boolean>
commitIntervalMs: <num>
directoryPerDB: <bool>
syncPeriodSecs: <int>
engine: <string>
wiredTiger:
engineConfig:
cacheSizeGB: <number>
journalCompressor: <string>
directoryForIndexes: <bool>
collectionConfig:
blockCompressor: <string>
indexConfig:
prefixCompression: <bool>
进程管理模块
processManagement:
fork: <boolean>
pidFilePath: <string>
安全模块
security:
authorization: enabled
keyFile: /path/mongo.key
clusterAuthMode: <string>
transitionToAuth: <boolean>
javascriptEnabled: <boolean>
redactClientLogData: <boolean>
sasl:
hostName: <string>
serviceName: <string>
saslauthdSocketPath: <string>
enableEncryption: <boolean>
encryptionCipherMode: <string>
encryptionKeyFile: <string>
kmip:
keyIdentifier: <string>
rotateMasterKey: <boolean>
serverName: <string>
port: <string>
clientCertificateFile: <string>
clientCertificatePassword: <string>
serverCAFile: <string>
ldap:
servers: <string>
bind:
method: <string>
saslMechanism: <string>
queryUser: <string>
queryPassword: <string>
useOSDefaults: <boolean>
transportSecurity: <string>
timeoutMS: <int>
userToDNMapping: <string>
authz:
queryTemplate: <string>
性能分析器(慢查询相关参数)
operationProfiling:
slowOpThresholdMs: <int>
mode: <string>
replication副本集相关参数
replication:
oplogSizeMB: <int>
replSetName: <string>
secondaryIndexPrefetch: <string>
enalbeMajorityReadConcern: <boolean>
sharding分片相关参数
sharding:
clusterRole: <string>
archiveMovedChunks: <bool>
setParameter自定义变量
setParameter:
<parameter1>: <value1>
<parameter2>: <value2>
enableLocalhostAuthBypass: false
auditLog审计相关参数:
auditLog:
destination: <string>
format: <string>
path: <string>
filter: <string>
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)