linux系统与进程文件打开数设置
source link: https://baorongquan.github.io/2019/08/08/linux%E7%B3%BB%E7%BB%9F%E4%B8%8E%E8%BF%9B%E7%A8%8B%E6%96%87%E4%BB%B6%E6%89%93%E5%BC%80%E6%95%B0%E8%AE%BE%E7%BD%AE/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
linux系统与进程文件打开数设置
场景是这样的:小伙伴在mongodb主备环境把备机停了一段时间后重新启动,mongodb主机在同步数据的过程中出现”too many open files error”, 在网上查到的说可以通过设置linux系统文件打开数来解决(服务器是Ubuntu),
然后开始一顿操作修改 /etc/security/limits.conf 进行设置
重启后 ulimit -a 查看系统文件打开数已修改。但是查看mongodb进程限制仍未改变
登陆mongo通过,查看mongo连接数仍未改变。
最后在stackoverflow 找到答案, 修改/etc/systemd/user.conf 以及 /etc/systemd/system.conf
添加以下内容
然后reboot重启后再看已生效
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK