Haproxy安装遇到:[WARNING] 143/145547 (17804) : [sbin/haproxy.main()] FD limit (1048576) too lowfor maxconn=65535/maxsock=131084.Please raise 'ulimit-n' to 131084 or more to avoid any trouble.

在安装完Haproxy启动时报错,诸如:FD limit (65535) too low for maxconn=65535/maxsock=131084.Please raise 'ulimit-n' to 131084 or more to avoid any trouble.遇到此类问题,搜了其他微博的文章,都是修改ulimit -n 65535 之类的。

照网上一些博客说的,有以下方法修改FD值: 
1.在/etc/rc.local 中增加一行 ulimit -SHn 65535 
2.在/etc/profile 中增加一行 ulimit -SHn 65535 
3.在/etc/security/limits.conf
如果在修改完之后依然解决不了。那么:

vim /haproxy/conf/haproxy.cfg

修改所有其中的maxconn  4096配置,在实验情况下可以将其改的小一些。

一般ulimit 值要比maxconn  4096大两倍。

作者:xiaomabrother

版权声明:本文为博主原创文章,转载请附上博文链接!

--------------------- 

原文地址:https://www.cnblogs.com/xiaomabrother/p/11268800.html