当我尝试运行日志聚合我发现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