memory locking requested for elasticsearch process but memory is not locked

系统:centos7.6 (vm虚拟机)

软件:java-1.8、elasticsearch-5.6.16-1.noarch

错误信息:

[2019-11-21T00:29:51,557][ERROR][o.e.b.Bootstrap          ] [elk-1] node validation exception
[1] bootstrap checks failed
[1]: memory locking requested for elasticsearch process but memory is not locked
 

解决方法一(关闭bootstrap.memory_lock:,会影响性能):

# vim /etc/elasticsearch/elasticsearch.yml          // 设置成false就正常运行了。

bootstrap.memory_lock: false
 

解决方法二(开启bootstrap.memory_lock:):

1. 修改文件/etc/elasticsearch/elasticsearch.yml,上面那个报错就是开启后产生的,如果开启还要修改其它系统配置文件 

bootstrap.memory_lock: true

2. 修改文件/etc/security/limits.conf,最后添加以下内容。      

* soft nofile 65536

* hard nofile 65536

* soft nproc 32000

* hard nproc 32000

* hard memlock unlimited

* soft memlock unlimited

3. 修改文件 /etc/systemd/system.conf ,分别修改以下内容。

DefaultLimitNOFILE=65536

DefaultLimitNPROC=32000

DefaultLimitMEMLOCK=infinity

改好后重启下系统。再启动elasticsearch就没报错了 。

 

----------------------

错误信息:

11月 22 18:26:13 filebeat.sh.com elasticsearch[9775]: ERROR: [1] bootstrap checks failed
11月 22 18:26:13 filebeat.sh.com elasticsearch[9775]: [1]: the default discovery settings are unsuitable for production use;...gured

解决方法:打开默认配置即可

# vim /etc/elasticsearch/elasticsearch.yml

discovery.seed_hosts: ["host1", "host2"]
cluster.initial_master_nodes: ["node-1", "node-2"]

# systemctl restart elasticsearch

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章