根據官網的提示內容,默認的配置文件內容爲javascript
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,首字母不能大寫java
systemLog.path爲一個文件名,不能爲一個文件夾,若是該文件已存在,會建立一個新的帶日期的文件mongodb
有了這個基礎,啓動時就能夠看啓動日誌文件來查看究竟是哪裏的配置有問題不能啓動安全
processManagement.pidFilePath爲一個文件地址,不存在也沒問題app
net.ssl最好所有註釋掉,暫時不用sslfetch
security下最好也註釋掉,不然須要配置所有安全內容,以及keyFile必定要存在。ui
storage.repairPath必定要是storage.dbPath的子目錄,且目錄須要存在。 spa
replication是複製,副本啓動,註釋掉debug
記得註釋掉一個引擎unix
這樣就能夠啓動了