前言

最新版本支持yaml格式的配置文件,只支持空格,不能使用tab

详细配置说明

#系统日志配置
systemLog:destination: filepath: /var/log/mongodb/mongod.loglogAppend: true#quiet模式运行,建议设置为false,方便排查错误quiet: false #进程管理
processManagement:#进程后台运行fork: true #进程pid文件 pidFilePath: /var/log/mongodb/mongod.pid  #网络配置
net:#监听端口port: 27017 #监听网卡 多个使用英文逗号隔开bindIp: 127.0.0.1 #最大并发连接数 默认65535maxIncomingConnections: 65535#验证客户端传过来的数据,文档嵌套多时,对性能会有些影响wireObjectCheck: true #是否启用ipv6,默认不启用ipv6: false unixDomainSocket:#是否启用socket监听 默认trueenabled: true #socket保存目录,默认/tmppathPrefix: /var/log/mongodb#socket文件权限,默认0700filePermissions: 0700 http:#是否启用http服务,默认false,安全考虑线上环境要关闭enabled: false #是否启用http jsonp,默认false,即使http.enabled为false,只要此项为true,一样可以访问,安全考虑线上环境要关闭JSONPEnabled: false #是否启用rest api接口,默认false,安全考虑线上环境要关闭RESTInterfaceEnabled: false ssl:#type:string#是否启用加密#可选值1 disabled:禁用#可选值2 allowSSL:优先使用非加密,但是服务器支持加密#可选值3 preferSSL:优先使用加密,但是服务器也支持非加密#可选值4 requireSSL:只支持加密mode: disabled #type:string#包含TLS/SSL certificate and key的文件路径#包含公钥和私钥PEMKeyFile: /var/log/mongodb/mongodb.pem#type:string#私钥加密时的密码PEMKeyPassword: password#type:string#The .pem file that contains the x.509 certificate-key file for membership authentication for the cluster or replica set.#不存在会使用PEMKeyFileclusterFile: /var/log/mongodb/cluster.pem#type:string#The password to de-crypt the x.509 certificate-key file specified with --sslClusterFileclusterPassword: password#type:string#The .pem file that contains the root certificate chain from the Certificate Authority.CAFile:  #type:string#The the .pem file that contains the Certificate Revocation List.CRLFile: #type:boolean#Enable or disable the requirement for TLS/SSL certificate validation that CAFile enablesallowConnectionsWithoutCertificates: true #type:boolean#Enable or disable the validation checks for TLS/SSL certificates on other servers in the cluster and allows the use of invalid certificates.allowInvalidCertificates: false #type:boolean#是否允许无效的域名,当为true时,mongod不检查证书里面域名的有效性,即使域名不匹配,mongod同样允许连接mongodb实例allowInvalidHostnames: false #type:string#禁用加密协议版本,多个使用英文逗号隔开#可设置的值TLS1_0, TLS1_1, and TLS1_2disabledProtocols: #type:string#Enable or disable the use of the FIPS mode of the installed OpenSSL library for the mongos or mongod.FIPSMode: false compression:#是否启用数据压缩compressors: snappy#安全配置
security:#type:string#密钥路径,副本集和分片集群节点间授权时使用的密钥keyFile:#type:string #集群授权模式,默认keyFile,值列表:keyFile,sendKeyFile,sendX509,x509clusterAuthMode: keyFile #type:string#是否开启数据库访问RBAC权限控制,默认:disabled,仅对mongod命令有效authorization: enabled #type:boolean#Allows the mongod or mongos to accept and create authenticated and non-authenticated connections to and from other mongod and mongos instances in the deployment.transitionToAuth: false #type:boolean#是否开启服端js执行,默认true,如果未开启$where,group,mapreduce都不能使用javascriptEnabled: true #type:boolean#写日志之前是否编辑客户端日志数据,去除日志中的敏感数据,仅企业版支持redactClientLogData: true #key管理配置
security:#type:boolean#WiredTiger存储引擎是否启用加密,默认false,仅企业版支持enableEncryption: false #type:string#加密模式,默认AES256-CBC,仅企业版支持encryptionCipherMode: AES256-CBC #type:string#密钥文件路径,仅企业版支持encryptionKeyFile: /var/log/mongodb/encKeyFile #kmip key server,仅企业版支持kmip: #type:string#Unique KMIP identifier for an existing key within the KMIP server.keyIdentifier: #type:boolean#If true, rotate the master key and re-encrypt the internal keystorerotateMasterKey: false #type:string#Hostname or IP address of key management solution running a KMIP server.serverName: #type:int#Port number the KMIP server is listening onport: 5696 #type:string#String containing the path to the client certificate used for authenticating MongoDB to the KMIP server.clientCertificateFile: #type:string#The password to decrypt the client certificate, used to authenticate MongoDB to the KMIP server.clientCertificatePassword: #type:string#Path to CA File. Used for validating secure client connection to KMIP server.serverCAFile: #sasal配置
security:sasl:hostName: "" #A fully qualified server domain name for the purpose of configuring SASL and Kerberos authentication. serviceName: "" #Registered name of the service using SASL. saslauthdSocketPath: "" #The path to the UNIX domain socket file for saslauthd#setParameter配置
setParameter:enableLocalhostAuthBypass: false#存储配置
storage:#type:string#数据库数据存储目录,默认/data/dbdbPath:#type:boolean#启动时是否尝试重建索引,默认trueindexBuildRetry: true #type:string#修复数据时使用的目录,默认是:A _tmp_repairDatabase_<num> directory under the dbPathrepairPath: #journal日志journal: #type:boolean#Enable or disable the durability journal to ensure data files remain valid and recoverable. Default: true on 64-bit systems, false on 32-bit systemsenabled: true #type:int#日志同步间隔,Values can range from 1 to 500 milliseconds.commitIntervalMs: 100 #type:boolean#是否开启一数据库一目录,默认是falsedirectoryPerDB: false #type:int#数据落地时间间隔,默认为60秒,不能设置为0,一般使用默认值即可syncPeriodSecs: 60 #type:string##存储引擎,默认wiredTiger,可选值 mmapv1,wiredTiger,inMemoryengine: wiredTiger#mmapv1存储引擎配置
storage:mmapv1:#type:boolean#默认true,Enables or disables the preallocation of data files. preallocDataFiles: true#type:int#默认16M The default size for namespace files, which are files that end in .ns. nsSize: 16 #配额 quota: #type:boolean#是否强制限制每个数据库数据文件数量限制,数量限制由maxFilesPerDB选项指定,默认为falseenforced: false #type:int#单个实例最大数据文件数量,需要先开启enforced配置,默认8maxFilesPerDB: 8 #type:boolean#小文件存储,默认为false,journal文件也会影响,适用场景:多数据库且数据量不大smallFiles: false journal:#type:boolean#journal调试标志,用于测试功能,一般情况下不使用,系统异常关机会影响数据的完整性debugFlags: 0 #type:int#version >= 3.2版本不建议使用commitIntervalMs: 60 #wiredTiger存储引擎配置
storage:wiredTiger:engineConfig:#type:float#单个实例可用的数据缓存内存大小,version >= 3.4默认:50% of RAM minus 1 GB, or 256 MB. Values can range from 256MB to 10TB and can be a float.cacheSizeGB: 0.25#type:string#WiredTiger journal数据压缩格式,默认snappy,可用的压缩类型: none, snappy, zlibjournalCompressor: snappy #type:boolean#索引文件分目录存储,默认false,version >= 3.0后版本可用directoryForIndexes: false collectionConfig:#type:string#块数据压缩格式,默认snappy,可用的压缩类型:none, snappy, zlibblockCompressor: snappyindexConfig:#type:boolean#是否开启索引prefix compression,默认trueprefixCompression: true #是否开启索引prefix compression,默认true#operationProfiling操作性能分析
operationProfiling:#type:int#慢查询时间单位毫秒,默认100,如果开启了profile,日志会保存到system.profile集合中slowOpThresholdMs: 100 #type:string#性能分析模式,开启会影响性能,谨慎操作。默认off.#可选值1:off: Off. No profiling.#可选值2: slowOp:On. Only includes slow operations.#可选值3: all:On. Includes all operations.mode: off#replication复制配置
replication:#type:int#数字类型(单位M) replication op log 大小,64位系统默认为可用磁盘的5%oplogSizeMB: 512#type:string#所属replica set集群名称replSetName: #type:string#The indexes that secondary members of a replica set load into memory before applying operations from the oplog. 默认all#可选值1 none:Secondaries do not load indexes into memory.#可选值2 all:Secondaries load all indexes related to an operation.#可选值3 _id_only:Secondaries load no additional indexes into memory beyond the already existing _id index.secondaryIndexPrefetch: all #type:boolean#默认false version >= 3.2版本可用 Enables read concern level of "majority".enableMajorityReadConcern:false #分片配置
sharding:#type:string#分片集群中的担当的角色#可选值1 configsvr:配置svr#可选值2 shardsvr: 数据svrclusterRole: shardsvr#type:boolean#默认false#During chunk migration, a shard does not save documents migrated from the shard.archiveMovedChunks: false#auditLog配置
#仅企业版支付
auditLog:#type:string#审计日志保存方式#可选值1 syslog:Output the audit events to syslog in JSON format. #可选值2 console:Output the audit events to stdout in JSON format.#可选值3 file:Output the audit events to the file specified in --auditPath in the format specified in --auditFormat.destination: syslog#type:string#日志格式#可选值1:JSON#可选值2:BSONformat: JSON#type:string#日志文件路径,相对路经和绝对路径都支持path: path/audit.log#type:string representation of a document#The filter to limit the types of operations the audit system records.#内容格式:{ <field1>: <expression1>, ... }filter: {}#snmp(简单网络管理协议)配置
snmp:#type:boolean#When snmp.subagent is true, SNMP runs as a subagent. For more information, see Monitor MongoDB With SNMP on Linux.subagent:false#type:boolean#When snmp.master is true, SNMP runs as a master. For more information, see Monitor MongoDB With SNMP on Linux.master:false#Text Search配置
basisTech:#type:string#v3.2版本加入#仅企业版支持#Specify the path to the root directory of the Basis Technology Rosette Linguistics Platform installation to support additional languages for text search operations.rootDirectory:/path/#mongos-only Options
replication:#type:integer#The ping time, in milliseconds, that mongos uses to determine which secondary replica set members to pass read operations from clients. #默认值为15毫秒localPingThresholdMs:15
sharding:#type:string#The configuration servers for the sharded cluster.#建议使用replica set#值格式:<configReplSetName>/cfg1.example.net:27017, cfg2.example.net:27017,...configDB:

  

参考文档

【1】服务器配置文档

https://docs.mongodb.com/manual/reference/configuration-options/

【2】服务器参数

https://docs.mongodb.com/manual/reference/parameters/

转载于:https://www.cnblogs.com/wadeyu/p/7928496.html

mongodb之配置相关推荐

  1. mongodb 主从配置,带auth验证模式

    2019独角兽企业重金招聘Python工程师标准>>> 一 简介说明 主从复制是mongodb最常用的复制方式,也是一个简单的数据库同步备份的集群技术,这种方式很灵活.可用于备份,故 ...

  2. NoSQL Manager for MongoDB 连接配置

    NoSQL Manager for MongoDB 连接配置 前提知道: mongodb.host=10.33.46.131:24800 mongodb.database=mariocache mon ...

  3. Windows MongoDB安装配置

    2019独角兽企业重金招聘Python工程师标准>>> 请使用新工具: NoSQL Manager for MongoDB,否则:MongoVUE连接报错(Invalid crede ...

  4. Mongodb 监控安装配置

    Mongodb 监控安装配置(MSS On-Prem) --- 沈海龙 Mongodb提供的MMS监控管理工具,是一个图形化的监控配置工具,界面非常友好,但是mongo-mms需要提交数据到mongo ...

  5. Mongodb从配置到应用

    Mongodb从配置到应用 早就想写一篇Mongodb的文章了,苦于木有时间呀,今天抽空将我所学习到的Mongodb知识整合一下,分享出来,部分Mongodb知识来源于网络.此处不给出链接,如果有侵犯 ...

  6. Linux下mongodb安装配置教程

    Linux下mongodb安装配置教程 这里写目录标题 Linux下mongodb安装配置教程 1. 在linux(ubuntu)下安装mongodb 2. 遇到的坑 1. 在linux(ubuntu ...

  7. 高可用mongodb集群的学习记录(二mongodb主从配置)

    二mongodb主从配置 在之前我们使用mysql数据库或者redis时大家广泛用到,采用双机备份后主节点挂掉了后从节点可以接替主机继续服务.所以这种模式比单节点的高可用性要好很多. 1.环境准备 实 ...

  8. mongodb安装配置启动

    官网下载 https://www.mongodb.com/ 配置环境变量 1. 打开环境配置文件 open ~/.bash_profile2. 添加环境配置MONGODB_HOME=/soft/mon ...

  9. MongoDB 安装配置

    1.下载地址 https://fastdl.mongodb.org/win32/mongodb-win32-x86_64-2008plus-ssl-4.0.9.zip 2.解压到 C:\MyProgr ...

  10. Mongodb主从配置

    一:使用命令行方式配置mongodb主从 [root@server11 ~]#  /usr/local/mongodb/bin/mongod --bind_ip 192.168.1.112 -port ...

最新文章

  1. 《PLACEBO》(安慰剂)米津玄師/野田洋次郎 (罗马音、歌词、汉译)
  2. python3.7入门教程-python 3.7极速入门教程6文件处理
  3. 关于SWT开发的一个坑——Invalid thread access
  4. java 概率 算法_使用概率算法优化快速排序(JAVA)
  5. java中catalina.out_catalina.out 和 catalina.log 的区别和用途
  6. netty搭建简单的文件服务器
  7. 鲲鹏性能优化十板斧(三)——网络子系统性能调优
  8. Android XmlPullParser 笔记
  9. js插入元素的新方法insertAdjacentHTML
  10. RDD 常见Action算子入门及应用
  11. 1.4.5 动态字段
  12. html ubb c,UBB代码和HTML代码的区别
  13. 一点点矩阵知识1:由一个矩阵理论题目展开的关于矩阵的核(kernel)与像(Image)的讲解。
  14. Axure学习笔记整理5-灯箱效果
  15. 秒杀项目的总结及面试常见问题
  16. TTMS剧院票务管理系统全网最全!!!不接受反驳
  17. APP爬虫|frida-某资讯app逆向过程,带你一起使用 frida 进行完整逆向
  18. 系统的入门脑机接口神经科学,一个网站就够了 - NeuroTechEDU
  19. 步进电机的细分驱动中1-2相, W1-2相, 2W1-2相, 4W1-2相 表示什么意思?
  20. HI3516EV100 AEC回音消除 + ANR语音降噪功能实现

热门文章

  1. 红外测距模块工作原理_共享单车里的通讯模块,工作原理是啥呢?
  2. 威学一百_精彩回顾深圳威学一百低龄校区圣诞活动精彩回顾!
  3. 【Mybatis】 mapper XML 文件中使用 association 实现一对一关联
  4. Tomcat的安装和运行
  5. floodlight java_floodlight学习系列(1)——在Eclipse中安装运行floodlight
  6. win10 linux重置密码忘记了,忘记密码时如何重新设置Windows10密码
  7. 2017计算机应用+简答,2017计算机应用基础试题及答案
  8. jq 自动打开浏览器_jQuery之解析判断当前页面打开端(APP或浏览器)的方法
  9. 专业音频如何把电平转换成dbu_这是我见过最细致的音频系统增益设置指南,跟着学起来!...
  10. 计算机技术会议排名,计算机学科会议排名