【问题标题】:Max file descriptors [4096] for elasticsearch process is too low when started ELASTICSEARCH启动 ELASTICSEARCH 时,Elasticsearch 进程的最大文件描述符 [4096] 太低
【发布时间】:2018-08-05 13:11:01
【问题描述】:

当我启动 elasticseach 时,我收到了这个警告:

[2018-08-05T15:04:27,370][WARN ][o.e.b.BootstrapChecks    ] [bDyfvVI] max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]

在运行本教程https://www.elastic.co/guide/en/elasticsearch/reference/current/file-descriptors.html 时,我已将所需的值设置为 65536。我也尝试了这些步骤:

Check ulimit -n, it would be 4096.

Edit /etc/security/limits.conf and add following lines:

*    soft nofile 65536

*    hard nofile 65536

root soft nofile 65536

root hard nofile 65536
Edit /etc/pam.d/common-session and add this line session required pam_limits.so
Edit /etc/pam.d/common-session-noninteractive and add this line session required pam_limits.so
Reload session and check for ulimit -n, it would be 65536.

不幸的是,我仍然收到此警告。谁能帮我解释一下为什么?

【问题讨论】:

  • 您找到解决方案了吗?

标签: elasticsearch


【解决方案1】:

我们通过更改 MAX_OPEN_FILES 中的值将其设置为 1024000 /etc/default/elasticsearch

更多信息在这里: https://www.elastic.co/guide/en/elasticsearch/reference/current/file-descriptors.html

Elasticsearch 使用了大量的文件描述符或文件句柄。文件描述符用完可能是灾难性的,并且很可能会导致数据丢失。确保将运行 Elasticsearch 的用户的打开文件描述符数限制增加到 65,536 或更高。

对于 .zip 和 .tar.gz 包,在启动 Elasticsearch 之前将 ulimit -n 65535 设置为 root,或者在 /etc/security/limits.conf 中将 nofile 设置为 65535。

在 macOS 上,您还必须将 JVM 选项 -XX:-MaxFDLimit 传递给 Elasticsearch,以便它利用更高的文件描述符限制。

RPM 和 Debian 软件包已经将文件描述符的最大数量默认为 65535,不需要进一步配置。

您可以使用 Nodes Stats API 检查为每个节点配置的 max_file_descriptors,其中:

GET _nodes/stats/process?filter_path=**.max_file_descriptors

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-04-11
    • 2022-01-01
    • 1970-01-01
    • 2021-01-11
    • 1970-01-01
    • 1970-01-01
    • 2018-07-22
    相关资源
    最近更新 更多