elasticsearch服务器7.1没有运行

时间:2019-07-09 13:14:03

标签: elasticsearch

我正在使用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服务器,但没有帮助

1 个答案:

答案 0 :(得分:0)

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

如果它不起作用

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

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

重新启动elasticsearch。

仍然无法正常工作吗?

如果未在其他位置设置限制,请检入.bashrc文件和其他类似文件。

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