当前elasticsearch版本8.11.4,报错内容如下:
[ERROR][o.e.b.Elasticsearch ] [ceph1] node validation exception [1] bootstrap checks failed. You must address the points described in the following [1] lines before starting Elasticsearch. For more information see [https://www.elastic.co/guide/en/elasticsearch/reference/8.11/bootstrap-checks.html] bootstrap check failure [1] of [1]: memory locking requested for elasticsearch process but memory is not locked; for more information see [https://www.elastic.co/guide/en/elasticsearch/reference/8.11/_memory_lock_check.html]
|-------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | 1 2 3 | [ERROR][o.e.b.Elasticsearch ] [ceph1] node validation exception [1] bootstrap checks failed. You must address the points described in the following [1] lines before starting Elasticsearch. For more information see [https://www.elastic.co/guide/en/elasticsearch/reference/8.11/bootstrap-checks.html] bootstrap check failure [1] of [1]: memory locking requested for elasticsearch process but memory is not locked; for more information see [https://www.elastic.co/guide/en/elasticsearch/reference/8.11/_memory_lock_check.html] |
这是因为在elasticsearch配置文件中开启了bootstrap.memory_lock: true参数。
解决办法:
1、如果你是rpm等相关方式安装的,可以通过以下方式解决
systemctl edit elasticsearch
|---|------------------------------| | 1 | systemctl edit elasticsearch |
[Service] LimitMEMLOCK=infinity
|-----|-----------------------------------| | 1 2 | [Service] LimitMEMLOCK=infinity |
按F2,再按y,再回车
2、如果你是通过.tar、.zip包安装的,可以通过以下方式解决
vi /etc/security/limits.conf
|---|------------------------------| | 1 | vi /etc/security/limits.conf |
elasticsearch soft memlock unlimited elasticsearch hard memlock unlimited
|-----|---------------------------------------------------------------------------| | 1 2 | elasticsearch soft memlock unlimited elasticsearch hard memlock unlimited |