ElasticSearch請求鎖住內存失敗

具體錯誤信息:node

[2020-04-18T21:40:31,571][ERROR][o.e.b.Bootstrap          ] [node-1] node validation exception
[1] bootstrap checks failed
[1]: memory locking requested for elasticsearch process but memory is not locked

解決思路:
(1)調整JVM內存爲物理機內存大小的50%,官方推薦,配置文件/etc/sysconfig/elasticsearchbootstrap

ES_JAVA_OPTS="-Xms4g -Xmx4g" 
MAX_LOCKED_MEMORY=unlimited

(2)修改/etc/security/limits.conf文的件內容,取消限制bash

elasticsearch soft memlock unlimited
elasticsearch hard memlock unlimited

(3)在/etc/systemd/system/elasticsearch.service.d目錄下建立一個文件override.conf,並添加下列內容。
這個elasticsearch.service.d也須要建立一下:elasticsearch

[Service]
LimitMEMLOCK=infinity

最後重啓機器,就行了。ide

相關文章
相關標籤/搜索