Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Introduction to [MongoDB] 3.0 configuration file

2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Overview:

You can start the control instance through the configuration file when you start mongod and mongos.

The configuration file contains settings equal to the mongod and mongos command options.

It is easier to manage mongod and mongos using configuration files, especially for large-scale deployments.

You can also add comments to the configuration file to explain the server settings options.

Use profile:

To start mongod and mongos, use the configuration file, which is specified with the-config or-f option.

Example:

Mongod-config / etc/mongod.conf / /-config can be replaced by-f

Mongos-config / etc/mongos.conf

File format:

The configuration file for Mongodb uses the YAML format.

Note: YAML does not accept tab, please use spaces instead.

Official address introduction: click to jump.

# here is the configurable content of the configuration file # Mongod config file# MongoDB configuration files use the YAML format.#The following example configuration file contains several mongod settings.#Example Start#systemLog:# destination: file# path: "/ var/log/mongodb/mongodb.log" # logAppend: true#storage:# journal:# enabled: true#processManagement:# fork: true#net:# bindIp: 127.0. 0.1# port: 27017#setParameter:# enableLocalhostAuthBypass: false#Example End#Core OptionssystemLog:# verbosity: 0 # Default: 0 1 to 5 increases the verbosity level to include Debug messages.# quiet: # traceAllException: # syslogFacility: user path: "/ usr/local/mongodb/log/mongod.log" logAppend: true# logRotate: # rename or reopen destination: file# timeStampFormat: iso8601-local# component:# accessControl:# verbosity: "command:# verbosity:" # COMMENT additional component verbosity settings omitted for brevity# Storage:# verbosity: Mr. journal:# verbosity: # write:# verbosity: 0#ProcessManagement OptionsprocessManagement: fork: true pidFilePath: "/ usr/local/mongodb/log/mongod.pid" # Net Optionsnet: port: 270mm bindIp: # Default All interfaces.# maxIncomingConnections: 6553clients wireObjectCheck: true# ipv6: False# unixDomainSocket:# enabled: true# pathPrefix: "/ tmp" # filePermissions: 070 percent http:# enabled: false# JSONPEnabled: false# RESTInterfaceEnabled: false# ssl:# sslOnNormalPorts: # deprecated since 2.percent mode: # PEMKeyFile: # PEMKeyPassword: # clusterFile: # clusterPassword: # CAFile: # CRLFile : # allowConnectionsWithoutCertificates: # allowInvalidCertificates: # allowInvalidHostnames: false# FIPSMode: # security Options#security:# keyFile: # clusterAuthMode: keyFile# authorization: disable# javascriptEnabled: true#security.sasl Options# sasl:# hostName: # serviceName: # saslauthdSocketPath: # setParameter OptionsetParameter: enableLocalhostAuthBypass: False#: #: # storage Optionsstorage: dbPath: "/ data/db" # indexBuildRetry: true# repairPath: "/ data/db/_tmp" # journal:# enabled: true# directoryPerDB: false# syncPeriodSecs: 60 engine: "mmapv1" # Valid options include mmapv1 and wiredTiger.#storage.mmapv1 Options# mmapv1:# preallocDataFiles: true# nsSize : "quota:# enforced: false# maxFilesPerDB:" smallFiles: false# journal:# debugFlags: # commitIntervalMs: 100 # 100 or 30#storage.wiredTiger Options# wiredTiger:# engineConfig:# cacheSizeGB: # Default: the maximum of half of physical RAM or 1 gigabyte# statisticsLogDelaySecs: "journalCompressor:" Snappy "# directoryForIndexes: false# collectionConfig:# blockCompressor:" snappy "# indexConfig:# prefixCompression: true#operationProfiling Options#operationProfiling:# slowOpThresholdMs: 10 years mode:" off "# replication Options#replication:# oplogSizeMB: # replSetName: # secondaryIndexPrefetch: all#sharding Options#sharding: # clusterRole: # configsvr or shardsvr# archiveMovedChunks: True#auditLog Options#auditLog:# destination: # syslog/console/file# format: # JSON/BSON# path: # filter: # snmp Options#snmp:# subagent: # master: # mongos-only Options#replication:# localPingThresholdMs: 15##sharding:# autoSplit: True# configDB: # chunkSize: 64#Windows Service Options#processManagement:# windowsService:# serviceName: # displayName: # description: # serviceUser: # servicePassword:

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report