MongoDB随笔(零) mongod配置 ...不断完善...会变得很长很长很长……
General 配置 | 中文说明 | 说明 |
---|---|---|
--quiet | 安静输出。 | Quieter output. |
--port arg | 指定服务端口号,默认端口27017。 | Specify port number - 27017 by default. |
--bind_ip arg | 绑定服务IP,若绑定127.0.0.1,则只能本机访问,不指定默认本地所有IP。 | Comma separated list of ip addresses to listen on - localhost by default. |
--bind_ip_all | 与bindIp是互斥的,bindIpAll表示允许所有的IPv4和IPv6地址访问。 | Bind to all ip addresses. |
--logpath arg | 指定MongoDB日志文件,注意是指定文件不是目录。 | Log file to send write to instead of stdout - has to be a file, not directory. |
--log append | 使用追加的方式写日志。 | Append to logpath instead of over-writing. |
--pidfilepath arg | PID File 的完整路径,如果没有设置,则没有PID文件。 | |
--- 集群验证 --- | ||
--auth | 启用验证。 | Run with security. |
--noauth | 不启用验证 | Run without security. |
--keyFile arg | 集群的私钥的完整路径,只对于Replica Set架构有效。 | Private key for cluster authentication. |
--clusterAuthMode arg | Authentication mode used for cluster authentication. Alternatives are (keyFile | sendKeyFile | sendX509 | x509) |
|
--clusterIpSourceWhitelist arg | Network CIDR specification of permitted origin for __system access. |
|
--unixSocketPrefix arg | UNIX域套接字替代目录,(默认为 /tmp)。 | Alternative directory for UNIX domain sockets (defaults to /tmp). |
--nounixsocket | 禁用Unix套接字监听。 | Disable listening on unix sockets. |
--listenBacklog arg (=128) | Set socket listen backlog size. | |
--fork | 以守护进程的方式运行MongoDB,创建服务器进程。 | Fork server process. |
--cpu | 定期地显示 cpu 和 iowait 利用率。 | Periodically show cpu and iowait utilization. |
--dialog arg | dialog选项 0=off,1=W,2=R,3=both,7=W+some reads。 | |
--journalOptions arg | 启用日志诊断选项。 | |
--ipv6 | 启用IPv6选项。 | Enable IPv6 support (disabled by default). |
--jsonp | 允许JONSP形式通过Http访问(有安全影响)。 | |
--maxConns arg (=1000000) | 最大同时连接数。 | Max number of simultaneous connections. |
--nohttpinterface | 关闭Http连接,默认关闭27018端口访问。 | |
--noprealloc | 禁用数据文件预分配(往往影响性能)。 | |
--noscripting | 禁用脚本引擎。 | Disable scripting engine. |
--notablescan | 不允许表扫描。 | Do not allow table scans. |
--nssize arg (=16) | 设置信数据库.ns文件大小(MB)。 | |
--objcheck | 在收到客户数据,检查的有效性。 | |
--profile arg | 档案参数 0=off,1=slow,2=all。 | 0=off, 1=slow, 2=all |
--quota | 限制每个数据库的文件数,设置默认为8。 | |
--quotaFiles arg | number of files allower per db, requires --quota | |
--rest | 开启简单的 rest API。 | |
--repairpath arg | 修复库生成的文件的目录,默认为目录名称dbpath。 | |
--slowms arg (=100) | Value of slow for profile and console log. | |
--smallfiles | 使用较小的默认文件。 | |
--slowOpSampleRate arg (=1) | Fraction of slow ops to include in the profile and console log. | |
--sysinfo | 打印一些诊断系统信息。 | Print some diagnostic system information. |
--upgrade | 如果需要升级数据库。 | Upgrade db if needed. |
-h [ -- help ] | Show this usage information. | |
--version | Show version information. | |
-f [ --config ] arg | Configuration file specifying additional options. | |
--configExpand arg | Process expansion directives in config file ( none, exec, rest) | |
--pidfilepath arg | Full path to pidfile (if not set, no pidfile is created). | |
--setParameter arg | Set a configurable parameter. | |
--syslog | Log to system's syslog facility instead of file or stdout. | |
--syslogFacility arg | syslog facility used for mongodb syslog message. | |
--logRotate arg | Set the log rotation behavior (rename | reopen). | |
--timeStampFormat arg | Desired format for timestamps in log messages. One of ctime, iso8601-utc, iso8601-local |
|
--transitionToAuth | For rolling access control upgrade. Attempt to authenticate over outgoing connections and proceed regardless of success. Accept incoming connections with or without authentication. |
|
--timeZoneInfo arg | Full path to time zone info directory, e.g. /usr/share/zoneinfo. | |
--filePermissions arg | Permissions to set on UNIX domain socket file - 0700 by default. | |
-v [ -- verbose ] [=arg(=v)] | Be more verbose (include multiple times for more verbosity e.g. -vvvvv) |
Replication 参数 | 中文说明 | 说明 |
---|---|---|
--oplogSize arg | 设置oplog的大小(单位MB)。 默认是硬盘空间的 5%。 |
Size to use (in MB) for replication op log. default is 5% of disk space(i.e. large is good). |
TLS 参数 | 中文说明 | 说明 |
---|---|---|
--tlsOnNormalPorts | Use TLS on configured ports. | |
--tlsMode arg | Set the TLS operation mode(disabled | allowTLS | perferTLS | requireTLS). | |
--tlsCertificateKeyFile arg | Certificate and key file for TLS. | |
--tlsCertificateKeyFilePassword arg | Password to unlock key in the TLS certificate key file. | |
--tlsClusterFile arg | Key file for internal TLS authentication. | |
--tlsClusterPassword arg | Internal authentication key file password. | |
--tlsCAFile arg | Certificate Authority file for TLS. | |
--tlsClusterCAFile arg | CA used for verifying remotes during inbound connections. | |
--tlsCRLFile arg | Certificate Revocation List file for TLS. | |
--tlsDisabledProtocols arg | Comma separated list of TLS protocols to disable [TLS1_0, TLS1_1, TLS1_2] | |
--tlsAllowConnectionsWithoutCertificates | Allow client to connect without presenting a certificate. | |
--tlsAllowInvalidHostnames | Allow server certificates to provide non-matching hostnames. | |
--tlsAllowInvalidCertificates | Allow connections to servers with invalid certificates. | |
--tlsFIPSMode | Activate FIPS 140-2 mode at startup. | |
--tlsCertificateSelector arg | TLS certificate in system store. | |
--tlsClusterCertificateSelector arg | SSL/TLS Certificate in system store for internal TLS authentication. | |
--tlsLogVersions arg | Comma separated list of TLS protocols to log on connect [TLS1_0, TLS1_1, TLS1_2] |
Storage 参数 | 中文说明 | 说明 |
---|---|---|
--storageEngine arg | What storage engine to use - defaults to wiredTiger if no data files present. | |
--dbpath arg | 指定数据库路径。 | Directory for datafiles - defaults to /data/db. |
--directoryperdb | 设置每个数据库将被保存在一个单独的目录。 | Each database will be stored in a separate directory. |
--syncdelay arg (=60) | 数据写入磁盘的时间秒数(0=never,不推荐)。 | Seconds between disk sync (0=never, but not recommended). |
--journalCommitInterval arg (=100) | how often to group/batch commit (ms). | |
--noIndexBuildRetry | Do not retry any index builds that were interrupted by shutdown. | |
--upgrade | Upgrade db if needed. | |
--repair | 修复所有数据库。 | Run repair on all dbs. |
--journal | 启用日志选项,MongoDB的数据操作将会写入到journal文件夹的文件里。 | Enable journaling. |
--nojournal | Disable journaling (journaling is on by default for 64 bit). |
Sharding 参数 | 中文说明 | 说明 |
---|---|---|
--configsvr | Declare this is a config db of a cluster; default port 27019; default dir /data/configdb. |
|
--shardsvr | Declare this is a shard db of a cluster; default port 27018. |
Free Monitoring 参数 | 中文说明 | 说明 |
---|---|---|
--enableFreeMonitoring arg | Enable Cloud Free Monitoring (on | runtime | off) | |
--freeMonitoringTag arg | Cloud Free Monitoring Tags. |
(Options )参数 就一个等下看看合并一下 | 中文说明 | 说明 |
---|---|---|
--networkMessageCompressors arg (=snappy, zstd, zlib) | Comma-separated list of compressors to use for network messages. |
Replica set 参数 | 中文说明 | 说明 |
---|---|---|
--replSet arg | arg is <setname> [/<optional seed host list>] | |
--enableMajorityReadConcern [=arg(=1)] (=1) | Enables majority readConcern. |
WiredTiger 参数 | 中文说明 | 说明 |
---|---|---|
--wiredTigerCacheSizeGB arg | Maximum amount of memory to allocate for cache; Defaults to 1/2 of physical RAM. |
|
--wiredTigerJournalCompressor arg (=snappy) | Use a compressor for log records [none | snappy | zlib | zstd] | |
--wiredTigerDirectoryForIndexes | Put indexes and data in different directories. | |
--wiredTigerMaxCacheOverflowFileSizeGB arg (=0) | Maximum amount of disk space to use for cache overflow; Defaults to 0 (unbounded). |
|
--wiredTigerCollectionBlockCompressor arg (=snappy) | Block compression algorithm for collection data [none | snappy | zlib | zstd] | |
--wiredTigerIndexPrefixCompression arg (=1) | Use prefix compression on row-store leaf pages. |