Configuration File Options
程序员文章站
2022-06-13 20:39:23
...
默认配置文件
- On Linux, a default
/etc/mongod.conf
configuration file is included when using a package manager to install MongoDB. - On Windows, a default
<install directory>/bin/mongod.cfg
configuration file is included during the installation. - On macOS, a default
/usr/local/etc/mongod.conf
configuration file is included when installing from MongoDB’s official Homebrew tap.
指定配置文件启动
# --config
mongod --config /etc/mongod.conf
mongos --config /etc/mongos.conf
# -f
mongod -f /etc/mongod.conf
mongos -f /etc/mongos.conf
# net 属性
net:
port: <int>
bindIp: <string>
bindIpAll: <boolean>
maxIncomingConnections: <int>
wireObjectCheck: <boolean>
ipv6: <boolean>
net.port:
27017 for mongod (if not a shard member or a config server member) or mongos instance
27018 if mongod is a shard member
27019 if mongod is a config server member
The TCP port on which the MongoDB instance listens for client connections.
net.
bindIp
默认localhost
要绑定到多个地址,输入用逗号分隔的值的列表
localhost, 2001:0DB8:e132:ba26:0d5c:2774:e7f9:d513
注意: ipv4的ip除了127.0.0.1和0.0.0.0之外,指定其他ip都会报错的
net.
bindIpAll
默认值:False
如果为true,则mongosor mongod实例绑定到所有IPv4地址(即0.0.0.0)
net.bindIp并且net.bindIpAll是互斥的。也就是说,您可以指定一个,但不能两个都指定
net.
maxIncomingConnections
默认值:65536
mongos或mongod将接受的最大同时连接数。如果此设置高于操作系统的配置的最大连接跟踪阈值,则此设置无效。
下一篇: 崇祯微服出宫,测字先生却说他性命不保
推荐阅读
-
spring5 源码深度解析----- 被面试官给虐懵了,竟然是因为我不懂@Configuration配置类及@Bean的原理
-
PHP file_get_contents函数读取远程数据超时的解决方法
-
PHP file_get_contents设置超时处理方法
-
通过Canvas及File API缩放并上传图片完整示例
-
PHP move_uploaded_file() 函数(将上传的文件移动到新位置)
-
详解ASP.NET Core实现强类型Configuration读取配置数据
-
HTML5新特性之type=file文件上传功能
-
vsftp上传553 Could not create file错误解决
-
C# transfer local file to remote server based on File.Copy
-
is_uploaded_file函数引发的不能上传文件问题