0

我通过运行脚本 startmongo.sh 以这种方式启动 MongoDB,该脚本将按顺序启动以下所有内容

./mongodb1.sh
./mongodb2.sh
./mongod3_arbiter.sh

每个 mongodb1.sh , mongodb2.sh , mongodb3_arbiter.sh 由代码组成

mongod --config mongod1.conf

mongod --config mongod2.conf

mongod --config mongod3_arbiter.conf

我想将连接限制增加到 10000 ,所以我想指定属性 ulimit -n 10000

我的问题是我是否需要在上述所有 conf 文件中指定此属性?

现在的conf包括

replSet = test
fork    = true
port    = 27017
dbpath  = /mongologs/mongodb3
logpath = /mongologs/mongo/mongodb3
rest = true

请让我知道,提前谢谢。

4

2 回答 2

0

H朋友,我觉得你需要设置maxpoolSize。

请查看mongoDB Docs

有描述像

uri.maxPoolSize¶
The maximum number of connections in the connection pool. The default value is 100.
于 2013-05-23T10:19:26.500 回答
0

这些设置在/etc/limits.conf(基于 debian)或/etc/security/limits.conf(基于 redhat)中,具体取决于您拥有的 linux 发行版。

您正在寻找nofile属性。

<domain>      <type>  <item>         <value>
*             soft    nofile         10000
*             hard    nofile         10000
于 2013-05-23T14:55:44.093 回答