我使用的是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
当我运行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文件中,对于日志中的错误1,在https://www.elastic.co/guide/en/elasticsearch/reference/current/setting-system-settings.html#limits.conf中给出,但是我没有解决这个问题,我再次尝试登录并运行elasticsearch服务器,但是没有帮助
发布于 2019-07-09 23:29:08
我认为您应该运行ulimit -n unlimited来使用来自/etc/security/limits.conf的值。
如果不工作,则返回
检查文件描述符数量的硬限制:ulimit -Hn。如果它低于65536,您将无法增加软限制。要增加硬限制,请以根用户身份连接并运行ulimit -Hn 65536。
使用elasticsearch用户使用ulimit -Sn 65536将软限制设置为65536
重新启动elasticsearch。
仍然不能工作?
如果没有在其他地方设置限制,请检入.bashrc文件和其他类似文件。
有关软/硬限制的详细信息,请阅读this article。
https://stackoverflow.com/questions/56953453
复制相似问题