MongoDB启动WARNING: soft rlimits too low. rlimits set to 1024 processes, 65535 files.

  • A+
所属分类:MongoDB

MongoDB在Linux上启动,有一些warning:

WARNING: /sys/kernel/mm/transparent_hugepage/enabled is 'always'.

WARNING: /sys/kernel/mm/transparent_hugepage/defrag is 'always'.

WARNING: soft rlimits too low. rlimits set to 1024 processes, 65535 files. Number of processes should be at least 32767.5 : 0.5 times number of files.

 

MongoDB启动WARNING: soft rlimits too low. rlimits set to 1024 processes, 65535 files.

针对前面两个WARNING,解决比较简单:

第三个WARNING提示的意思就是说MongoDB的软件进程被限制了,MongoDB希望自己是最少32767.5

我们需要将限制的processes从1024 -> 32000 或者更大

首先我们查看当前的MongoDB进程信息:

显示如下结果:

可以看到mongod的进程号是:13974

我们继续查看mongod进程的系统限制:

显示如下结果:

可以看到限制Max processes, Max open files

如何修改呢?有两种办法:

  • 修改配置文件/etc/security/limits.d/90-nproc.conf

然后重启MongoDB服务即可:

  • 修改配置文件/etc/security/limits.conf,添加配置信息:

然后重启MongoDB服务即可:

参考:

MongDB 启动警告 WARNING: soft rlimits too low

Mongodb 启动报错:"/sys/kernel/mm/transparent_hugepage/enabled is 'always'"

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: