MongoDB YAML格式的設定檔

來源:互聯網
上載者:User

標籤:

  根據官網的提示內容,預設的設定檔內容為

  

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: 0processManagement:   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: trueoperationProfiling:   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格式的設定檔

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.