根据官网的提示内容,默认的配置文件内容为

  

systemLog:
verbosity: 0
quiet: false
# traceAllExceptions: <boolean>
syslogFacility: user
path: "/data/mongodb/log"
logAppend: false
logRotate: rename
destination: file
timeStampFormat: iso8601-local
component:
accessControl:
verbosity: 0
command:
verbosity: 0
# COMMENT some component verbosity settings omitted for brevity
storage:
verbosity: 0
journal:
verbosity: 0
write:
verbosity: 0
processManagement:
fork: false
pidFilePath: "/var/run/mongodb/mongod.pid"
net:
port: 27017
bindIp: "127.0.0.1"
maxIncomingConnections: 65536
wireObjectCheck: true
ipv6: false
unixDomainSocket:
enabled: true
pathPrefix: "/tmp"
filePermissions: 0700
http:
enabled: true
JSONPEnabled: false
RESTInterfaceEnabled: false
# ssl:
# sslOnNormalPorts: <boolean> # deprecated since 2.6
# mode: disabled
# PEMKeyFile: <string>
# PEMKeyPassword: <string>
# clusterFile: <string>
# clusterPassword: <string>
# CAFile: <string>
# CRLFile: <string>
# allowConnectionsWithoutCertificates: <boolean>
# allowInvalidCertificates: <boolean>
# allowInvalidHostnames: <boolean>
# FIPSMode: <boolean>
#security:
# keyFile: "/var/lib/mongo/mongodb-keyfile"
# clusterAuthMode: keyFile
# authorization: disabled
# javascriptEnabled: true
# sasl:
# hostName: <string>
# serviceName: <string>
# saslauthdSocketPath: <string>
#setParameter:
# <parameter1>: <value1>
# <parameter2>: <value2>
storage:
dbPath: "/data/db"
indexBuildRetry: true
repairPath: "/data/db/tmp"
journal:
enabled: true
directoryPerDB: false
syncPeriodSecs: 60
engine: mmapv1
mmapv1:
preallocDataFiles: true
nsSize: 16
quota:
enforced: false
maxFilesPerDB: 8
smallFiles: false
journal:
debugFlags: 1
commitIntervalMs: 100
# wiredTiger:
# engineConfig:
# cacheSizeGB: 1
# statisticsLogDelaySecs: 0
# journalCompressor: snappy
# directoryForIndexes: false
# collectionConfig:
# blockCompressor: snappy
# indexConfig:
# prefixCompression: true
operationProfiling:
slowOpThresholdMs: 100
mode: off
#replication:
# oplogSizeMB: 50
# replSetName: repl_test
# secondaryIndexPrefetch: all
#sharding:
# clusterRole: <string>
# archiveMovedChunks: <boolean>
#auditLog:
# destination: file
# format: JSON
# path: "/data/mongodb/log"
# filter: <string>
#snmp:
# subagent: <boolean>
# master: <boolean> #mongos only
#replication:
# localPingThresholdMs: <boolean>
#sharding:
# autoSplit: <boolean>
# configDB: <string>
# chunkSize: <int>

注意:boolean值为true或者false,首字母不能大写

  systemLog.path为一个文件名,不能为一个文件夹,如果该文件已存在,会创建一个新的带日期的文件

  有了这个基础,启动时就可以看启动日志文件来查看到底是哪里的配置有问题不能启动

  processManagement.pidFilePath为一个文件地址,不存在也没问题

  net.ssl最好全部注释掉,暂时不用ssl

  security下最好也注释掉,否则需要配置全部安全内容,以及keyFile一定要存在。

  storage.repairPath一定要是storage.dbPath的子目录,且目录需要存在。  

  replication是复制,副本启动,注释掉

  记得注释掉一个引擎

  这样就可以启动了

MongoDB YAML格式的配置文件的更多相关文章

  1. Go 处理yaml类型的配置文件

    先说一下,这里用到了很多关于反射类型的功能,可能刚开始看代码,如果对反射不熟悉的可能会不是非常清晰,但是同时也是为了更好的理解golang中的反射,同时如果后面想在代码中可以直接从我的git地址get ...

  2. mongodb3.2配置文件yaml格式 详解

    mongodb3.x版本后就是要yaml语法格式的配置文件,下面是yaml配置文件格式如下:官方yaml配置文件选项参考:https://docs.mongodb.org/manual/ ... #c ...

  3. yaml格式配置文件

    YAML 是一种可读性非常高,与程序语言数据结构非常接近.同时具备丰富的表达能力和可扩展性,并且易于使用的数据标记语言. python中处理 Yaml 格式的数据需要先下载pyyaml: pip in ...

  4. golang使用yaml格式解析构建配置文件

    现在主流的配置文件格式有这么几种,xml.yaml.config…  xml就算了,太挫了,太土, 太繁琐… config 就是mysql,apache my.cnf的那种格式,这个格式适合功能分层, ...

  5. kubernetes yaml格式的Pod配置文件

    kubernetes yaml文件解析 # yaml格式的pod定义文件完整内容: apiVersion: v1 #必选,版本号,例如v1 kind: Pod #必选,Pod metadata: #必 ...

  6. .net core读取json格式的配置文件

    在.Net Framework中,配置文件一般采用的是XML格式的,.NET Framework提供了专门的ConfigurationManager来读取配置文件的内容,.net core中推荐使用j ...

  7. 如何修改geditor的配置文件 -好像geditor没有文本格式的配置文件? 要使用dconf-editor来配置- geditor自己配置编码格式

    好像geditor没有文本格式的配置文件? 好像是通过一个程序, 叫 dconf-editor 来配置geditor的? 以前是通过gconf-editor来配置的, 但是gconf-editor的配 ...

  8. Unity3D可以查看YAML格式的场景文件,采用Notepad++

    在Editor Settings 将Asset Serialization 的 mode设置成Force Text,否则不能查看YAML格式! Unity圣典描述:Textual Scene File ...

  9. Fiddler插件---将Mapi请求自动转为HTTPRunner测试用例(YAML格式)

    背景 继之前鼓捣出了Mapi解密插件之后,在团队内已经使用了三年之久,一跃成为团队最爱欢迎的测试工具之一(加个之一,低调谦虚一点). 随着团队推行HttpRunner搞接口自动化:编写和维护Case带 ...

随机推荐

  1. BIOS设置图解教程-看完就没有不明白的了

    BIOS(基本输入/输出系统)是被固化在计算机CMOS RAM芯片中的一组程序,为计算机提供最初的.最直接的硬件控制.BIOS主要有两类∶AWARD BIOS和AMI BIOS.正确设置BIOS可大大 ...

  2. sublime中开启表格插入

    1. 导入包 tableedit 2. ctrl+shift +p 输入teecv,然后开启后面连个东西: 3 按tab可以插入表格

  3. 不同的类UNIX操作系统密码破解方法介绍

    (一)Linux 系统密码破解 1.在grub选项菜单按E进入编辑模式 2.编辑kernel那行 /init 1 (或/single) 3.按B重启 4.进入后执行下列命令 root@#passwd ...

  4. angularjs之向下一个页面传参

    原理: 1.在a标签跳转时,连接后增加一个参数值 2.在路由中接收 3.在控制器中接收 实现: 1.<a href="#/list/{{val.id}}"> 2.在js ...

  5. pipenv 简要指南

    pipenv 简要指南 pipenv是requests作者的一个项目, 整合了virtualenv, pip, pipfile, 用于更方便地为项目建立虚拟环境并管理虚拟环境中的第三方模块. 安装 直 ...

  6. U3D中物体的渲染顺序

    1,由SHADER中渲染队列及队列中的值决定 2,在同一队列中,若材质相同 2.1 对于UI,按其在场景层级中的先后顺序绘制 2.2 对于3D不透明物体,按其离相机的距离,由近到远绘制,这样可以减少像 ...

  7. java反射(Field的应用)

    //$Id: DirectPropertyAccessor.java 11405 2007-04-15 12:50:34Z max.andersen@jboss.com $ package org.h ...

  8. Etcd的基本使用

    etcd 是 CoreOS 团队于 2013 年 6 月发起的开源项目,它的目标是构建一个高可用的分布式键值(key-value)数据库,基于 Go 语言实现,内部采用 raft 协议作为一致性算法. ...

  9. iOS 布局之 Springs and Struts

    “springs and struts” 模式,就是代码中的autosizing masks布局控制. autosizing mask决定了一个view会发生什么当它的superview 改变大小的时 ...

  10. 从零开始搭建k8s-20180301

    yum install -y yum-utils git etcd yum-config-manager --add-repo https://download.docker.com/linux/ce ...