【问题标题】:elasticsearch server 7.1 is not running弹性搜索服务器 7.1 未运行
【发布时间】:2019-11-19 01:30:18
【问题描述】:

我正在使用 elasticsearch 7.2 版,我想在生产模式下使用它,因为我对其 elasticsearch.yml 文件进行了一些更改,例如

network.host: 0.0.0.0
discovery.seed_hosts: ["192.168.1.8"]

通过以下链接 https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-network.html https://www.elastic.co/guide/en/elasticsearch/reference/current/discovery-settings.html

https://www.elastic.co/guide/en/elasticsearch/reference/7.0/breaking-changes-7.0.html#breaking_70_discovery_changes

当我运行 elasticsearch 服务器时,它会抛出两条错误消息

[2019-07-09T18:07:04,978][DEBUG][o.e.a.ActionModule       ] [sara-Inspiron-7773] Using REST wrapper from plugin org.elasticsearch.xpack.security.Security
[2019-07-09T18:07:05,759][INFO ][o.e.d.DiscoveryModule    ] [sara-Inspiron-7773] using discovery type [zen] and seed hosts providers [settings]
[2019-07-09T18:07:06,418][INFO ][o.e.n.Node               ] [sara-Inspiron-7773] initialized
[2019-07-09T18:07:06,419][INFO ][o.e.n.Node               ] [sara-Inspiron-7773] starting ...
[2019-07-09T18:07:06,525][INFO ][o.e.t.TransportService   ] [sara-Inspiron-7773] publish_address {192.168.1.8:9300}, bound_addresses {[::]:9300}
[2019-07-09T18:07:06,531][INFO ][o.e.b.BootstrapChecks    ] [sara-Inspiron-7773] bound or publishing to a non-loopback address, enforcing bootstrap checks
ERROR: [2] bootstrap checks failed
[1]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65535]
[2]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
[2019-07-09T18:07:06,568][INFO ][o.e.n.Node               ] [sara-Inspiron-7773] stopping ...
[2019-07-09T18:07:06,579][INFO ][o.e.n.Node               ] [sara-Inspiron-7773] stopped
[2019-07-09T18:07:06,580][INFO ][o.e.n.Node               ] [sara-Inspiron-7773] closing ...
[2019-07-09T18:07:06,594][INFO ][o.e.n.Node               ] [sara-Inspiron-7773] closed
[2019-07-09T18:07:06,596][INFO ][o.e.x.m.p.NativeController] [sara-Inspiron-7773] Native controller process has stopped - no new native processes can be started

我确实添加了

elasticsearch    -       nofile          65535

/etc/security/limits.conf 文件中,如 https://www.elastic.co/guide/en/elasticsearch/reference/current/setting-system-settings.html#limits.conf 对于日志中的错误 [1],但我没有解决问题 我尝试再次登录并运行 elasticsearch 服务器,但没有帮助

【问题讨论】:

  • /etc/security/limits.conf 在启动时应用。你重启了吗?

标签: elasticsearch


【解决方案1】:

我认为您应该运行 ulimit -n unlimited 以使用来自 /etc/security/limits.conf 的值。

如果不起作用

检查文件描述符数量的硬限制:ulimit -Hn。如果它低于 65536,您将无法增加软限制。要增加硬限制,请以 root 身份连接并运行 ulimit -Hn 65536

使用elasticsearch用户使用ulimit -Sn 65536将软限制设置为65536

重启弹性搜索。

还是不行?

如果其他地方没有设置限制,请检查 .bashrc 文件和其他类似文件。

您可以阅读this article 了解有关软/硬限制的详细信息。

【讨论】:

  • 我以 root 身份登录,然后 ulimit -n 返回 1024,然后我做了 ulimit -n 65530 并再次检查 ulimit -n 返回 65530 并运行 elasticsearch server 它给出了相同的错误消息我在上面的日志中提到过
  • 我已经用更详细的解决方案更新了响应。
  • "Using elasticsearch use"是什么意思我没有elasticsearch用户
  • 如果您没有elasticsearch用户,请使用启动elasticsearch的用户。如果您使用的是服务,您可能有一个 elasticsearch 用户。检查elasticsearch.service 文件。
  • 启动名为 sara 的弹性搜索的用户添加了 sara - nofile 65535 并再次启动,但问题仍然存在
猜你喜欢
  • 2022-11-13
  • 2019-07-18
  • 2015-11-24
  • 2021-01-20
  • 2015-04-12
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多