![elasticsearch:elasticsearch 进程的最大文件描述符 [1024] 太低,请至少增加到](https://linux22.com/image/717544/elasticsearch%EF%BC%9Aelasticsearch%20%E8%BF%9B%E7%A8%8B%E7%9A%84%E6%9C%80%E5%A4%A7%E6%96%87%E4%BB%B6%E6%8F%8F%E8%BF%B0%E7%AC%A6%20%5B1024%5D%20%E5%A4%AA%E4%BD%8E%EF%BC%8C%E8%AF%B7%E8%87%B3%E5%B0%91%E5%A2%9E%E5%8A%A0%E5%88%B0%20.png)
当我尝试运行日志聚合我发现elasticsearch产生了以下错误:
[2018-02-04T13:44:04,259][INFO ][o.e.b.BootstrapChecks ] [elasticsearch-logging-0] bound or publishing to a non-loopback or non-link-local address, enforcing bootstrap checks
ERROR: [1] bootstrap checks failed
[1]: max file descriptors [1024] for elasticsearch process is too low, increase to at least [65536]
[2018-02-04T13:44:04,268][INFO ][o.e.n.Node ] [elasticsearch-logging-0] stopping ...
[2018-02-04T13:44:04,486][INFO ][o.e.n.Node ] [elasticsearch-logging-0] stopped
[2018-02-04T13:44:04,486][INFO ][o.e.n.Node ] [elasticsearch-logging-0] closing ...
[2018-02-04T13:44:04,561][INFO ][o.e.n.Node ] [elasticsearch-logging-0] closed
[2018-02-04T13:44:04,564][INFO ][o.e.x.m.j.p.NativeController] Native controller process has stopped - no new native processes can be started
顺便说一句,我在 Ubuntu 机器 16.04 上使用 cri-containerd 在 minions 上运行 kubernetes 集群 v1.8.0,在 master 上运行 1.9.0。
任何帮助将不胜感激。
答案1
这在文档中有介绍; https://www.elastic.co/guide/en/elasticsearch/reference/current/file-descriptors.html您将需要更改进程可用的文件句柄的 ulimit。
要持久设置文件句柄的限制,您可以将其添加到限制文件中;
# /etc/security/limits.conf
elasticsearch - nofile 65536
并重新启动服务。在 Ubuntu 上,可能需要启用 pam limits.conf
如果您使用的是 systemd,则这些值将在文件中设置elasticsearch.service
,但这通常由已安装的软件包完成。您可以覆盖这些设置...
/etc/systemd/system/elasticsearch.service.d/override.conf
[Service]
LimitMEMLOCK=infinity