<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                [TOC] ## 一 配置文件說明 MongoDB有兩種配置文件格式,分別是: [3.2版官方yaml配置文件選項參考](https://docs.mongodb.com/v3.2/reference/configuration-options) 1. 用`=`號的常規格式 類似my.conf等常規配置的文件 2. yaml語法的新格式 mongodb3.x版本后就是要yaml語法格式的配置文件,下面是yaml配置文件格式如下: 切記yaml只能使用空格,不支持tab鍵,切記 ### 配置舉例 **配置文件** ```yaml systemLog: destination: file path: "/var/log/mongodb/mongod.log" logAppend: true storage: journal: enabled: true processManagement: fork: true net: bindIp: 127.0.0.1 port: 27017 setParameter: enableLocalhostAuthBypass: false ``` **指定配置啟動** ```sh mongod --config? /etc/mongod.conf # 或者 mongod -f /etc/mongod.conf ``` ### 配置文件模塊 mongod.conf配置文件分為如下幾塊內容: ``` systemLog: #日志模塊相關參數 storage: #存儲引擎相關參數 processManagement: #進程管理 net: #網絡 security: #安全 operationProfiling: #性能分析器 replication: #主從復制配置 sharding: #分片集群配置 setParameter: #自定義變量 auditLog: #檢測日志 snmp: # ``` ## 二 詳細配置部分 ### A `systemLog`日志相關參數 ~~~yaml systemLog: verbosity: <int> #日志級別,默認0,1-5均會包含debug信息 quiet: <bool> #安靜,true時將會減少日志的輸出量 traceAllExceptions: <bool> #打印異常詳細信息 syslogFacility: <string> #啟用syslog指定用于登錄時信息到syslog Facility水平,前提是 path: <string> #日志路徑 logAppend: <bool> #追加日志還是新建日志 logRotate: rename|reopen #日志輪詢。默認值rename;reopen前提為 logAppend: true destination: <string> #日志輸出目的地,可為file或syslog,不指定會輸出到標準輸出 timeStampFormat: <string> #日志時間戳格式,有 ctime,Iso869-utc,iso8691-local component: #為不同的組件指定各自的日志信息級別 accessControl: verbosity: <int> command: verbosity: <int> ~~~ ### B `storage`存儲引擎相關參數 ~~~yaml storage: dbPath: <string> #數據存儲目錄 indexBuildRetry: <bool> #構件索引時mongod意外關閉,啟動是否重建索引,默認true repairPath: <string> #在repair期間臨時數據目錄 journal: enabled: <boolean> #journal日志是否持久存儲,通常用于數據故障恢復,建議開啟 commitIntervalMs: <num> #mongod日志刷新值,范圍1-500毫秒,默認100,不建議修改 directoryPerDB: <bool> #是否將不同的數據存儲在不同的目錄中,需為dbPath子目錄 syncPeriodSecs: <int> #fsync操作將數據flush到磁盤的時間間隔,默認為60秒,不建議修改 engine: <string> #存儲引擎類型,3.2前默認 mmapv1,3.2后默認WiredTiger wiredTiger: #存儲引擎配置 engineConfig: cacheSizeGB: <number> #最大緩存大小 journalCompressor: <string> #日志壓縮算法,可選值有 none,snappy(默認),zlib directoryForIndexes: <bool> #是否將索引和集合數據分別存儲在dbPath單獨的目錄中 collectionConfig: blockCompressor: <string> #collection數據壓縮算法,可選none, snappy,zlib indexConfig: prefixCompression: <bool> #是否對索引數據使用前綴壓縮。可有效減少索引數據的內存使用量。 ~~~ ### C `processManagement`進程相關參數 ~~~yaml processManagement: fork: <boolean> #是否以守護進程運行,默認false pidFilePath: <string> #將mongod進程ID寫入指定文件,默認不會創建 ~~~ ### D `net`網絡相關參數 ~~~xml net: prot: <int> #監聽端口,默認27017 bindIp: <string> #綁定IP,如果此值是“0.0.0.0”則綁定所有接口 maxIncomingConnections: <int> #進程允許的最大連接數,上限是系統閾值(ulimit) wireObjectCheck: <boolean> #當客戶端寫入數據時,是否檢查數據的有效性(BSON),有效的數據才執行 ipv6: <bool> #是否支持多實例之間使用ipv6 http: #http配置 enabled: <boolean> JSONEnabled: <boolean> RESTInterfaceEnabled: <boolean> ssl: #https配置 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> ~~~ ### E `security`安全相關參數 ~~~yaml security: authorization: enabled #MondoDB認證功能 keyFile: /path/mongo.key #MongoDB副本集節點身份驗證密鑰文件 clusterAuthMode: <string> #集群members間的認證模式 transitionToAuth: <boolean> javascriptEnabled: <boolean> #是否允許執行JavaScript腳本 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> ~~~ ### F `operationProfiling`慢查詢相關參數: ~~~yaml operationProfiling: slowOpThresholdMs: <int> #“慢查詢”的時間閾值,單位毫秒(默認100ms) mode: <string> #數據庫profiler級別,可選值“off|slowOp|all” #數據庫profiling會影響性能,建議只在性能調試階段開啟,mongod會把慢查詢記錄到日志中 ~~~ ### G `replication`副本集相關參數: ~~~yaml replication: oplogSizeMB: <int> #replication操作日志的最大尺寸,如果太小則全量同步 replSetName: <string> #副本集名稱,副本集中所有的mongod實例都必須有相同的名字 secondaryIndexPrefetch: <string> #副本集中的secondary,從oplog中應用變更操作前,會先把索引加載到內存 enalbeMajorityReadConcern: <boolean> #允許readConcern的級別為“majority” ~~~ ### H `sharding`分片相關參數: ~~~yaml sharding: clusterRole: <string> #在sharding集群中的角色。configsvr(27019)|shardsvr(27018) archiveMovedChunks: <bool> #當chunks遷移后,是否歸檔并保存這些chunks在dbPath/movechunk目錄下 ~~~ ### I `setParameter`自定義變量: ~~~yaml setParameter: <parameter1>: <value1> <parameter2>: <value2> enableLocalhostAuthBypass: false #栗子 ~~~ ### J `auditLog`審計相關參數: ~~~yaml auditLog: destination: <string> #指定審計記錄的輸出方式,有syslog|console|file format: <string> #輸出格式,有JSON 和 BSON path: <string> #如果輸入為文件,那么指定文件完整路徑及文件名 filter: <string> #過濾器,可限制審計系統記錄的操作類型 ~~~
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看