max file descriptors [4096] for elasticsearch process is too low, increase to at

错误:

max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]

解决办法:

将当前用户的软硬限制调大。

找到文件 /etc/security/limits.conf,编辑,在文件的最后追加如下配置:

es soft nofile 65535

es hard nofile 65537

soft nofile表示软限制,hard nofile表示硬限制,

上面两行语句表示,es用户的软限制为65535,硬限制为65537,

即表示es用户能打开的最大文件数量为65537,不管它开启多少个shell。

硬限制是严格的设定,必定不能超过这个设定的数值。

软限制是警告的设定,可以超过这个设定的值,但是若超过,则有警告信息。

在设定上,通常soft会比hard小,举例来说,sofr可以设定为80,而hard设定为100,那么你可以使用到90(因为没有超过100),但介于80~100之间时,系统会有警告信息。

修改了limits.conf,不需要重启,重新登录即生效。

查看当前用户的软限制

命令:ulimit -n  等价于 ulimit -S -n

结果:65535

查看当前用户的硬限制

命令:ulimit -H -n

结果:65537

猜你喜欢

转载自huangqiqing123.iteye.com/blog/2398224