ElasticSearch: Enable Mlockall in CentOS 7
I have recently been wrestling with ElasticSearch/Elastic and how to finally enable mlockall under CentOS 7. You usually will get the “Unable to lock JVM memory (ENOMEM). This can result in part of the JVM being swapped out. Increase RLIMIT_MEMLOCK (ulimit)`.”
These are all the places I made changes to get it to work. Now, I don’t know if some of these steps are skippable (my guess is some of them are), but I got it working i nthe end, and my nodes are now happily showing `mlockall: true“
Make sure
bootstrap.mlockall: true
is uncommented in/etc/elasticsearch/elasticsearch.yml
or the appropiate config file for your configuration.Edit
/etc/security/limits.conf
and add these lines (or edit them if applicable). You usually will want to add them at the very end of the file.
- Edit
/etc/sysconfig/elasticsearch
. You will find these values commented, and possibly without values. Change them to these:
- Edit
/usr/lib/systemd/system/elasticsearch.service
and make sureLimitMEMLOCK
is uncommented and set to infinity
- Edit
/etc/init.d/elasticsearch
and addsu $ES_USER --shell /bin/bash -c "ulimit -l unlimited"
before the actual start of ES, this is more or less how it looks in mine:
After I had everything in place, I restared my nodes and now they all show mlockall: true
when checked with curl http://localhost:9200/_nodes/process?pretty
Hope this helps someone!
'ElasticSearch > 외부자료' 카테고리의 다른 글
[외부] ELASTICSEARCH – 2. SHARD & REPLICA (0) | 2018.04.20 |
---|---|
[외부] Elasticsearch 인덱싱 최적화 (0) | 2018.04.17 |
[외부] Elasticsearch Configuration (0) | 2018.04.13 |
[외부] Elasticsearch로 로그 수집하기, 실전! (0) | 2018.04.12 |
[외부] Rolling Restarts [클러스터(또는 노드) 재시작하기] (0) | 2018.04.05 |