I read a lot around, but I'm not able to set mlockall as 'true' yet.
Can you please help me?
This is the procedure I followed so far:
elasticsearch config # vim /etc/elasticsearch/elasticsearch.yml
bootstrap.mlockall: true
added memlock unlimited in system security limits # vim /etc/security/limits.conf
elasticsearch - memlock unlimited
root - memlock unlimited```
add these lines for sysconfig
```# vim /etc/sysconfig/elasticsearch```
```ES_HEAP_SIXE=8g
MAX_OPEN_FILES=65535
MAX_LOCKED_MEMORY=unlimited```
uncomment also this line for systemd (even if I'm using SystemV)
```# vim /usr/lib/systemd/system/elasticsearch.service```
```(uncomment)
LimitMEMLOCK=infinity```
to be sure I also added "ulimit -l unlimited" when start elasticsearch the service
```# vim /etc/init.d/elasticsearch```
```(add)
su $ES_USER --shell /bin/bash -c "ulimit -l unlimited"```
changed the TMP directory to be sure is not mounted as 'noexec'
```# mkdir /opt/apps/elasticsearch/tmp```
```# vim /etc/sysconfig/elasticsearch```
```(change tmp directory)```
```#WORK_DIR=/tmp/elasticsearch
WORK_DIR=/opt/apps/elasticsearch/tmp```
start the service
```# service elasticsearch start```
check heap size (OK - uses 8Gb)
```# ps aux | grep elastic
497 26547 200 1.0 11122692 167744 ? Sl 10:47 0:04 /usr/bin/java -Xms8g -Xmx8g -Djava.awt.headless``
check mlockall (still false)
```# curl http://localhost:9200/_nodes/process?pretty | grep mlockall```
"mlockall" : false
"mlockall" : false
"mlockall" : false
"mlockall" : false
"mlockall" : false
"mlockall" : false
"mlockall" : false
Thanks
running elasticsearch 1.5.2 with java8. what I did is uncomment the bootstrap.mlockall: true and restart the node. other settings pretty much centos stock settings.
it worked for me after setting up also the WORK_DIR on a different path than /tmp ( because the /tmp directory is mounted as 'noexec') and appending "-Djna.tmpdir=$WORK_DIR" as additional parameter in elasticsearch start command line inside /etc/init.d/elasticsearch ( even if there is already a parameter like "-Des.default.path.work=$WORK_DIR" ).
The third option is to use mlockall on Linux/Unix systems, or VirtualLock on Windows, to try to lock the process address space into RAM, preventing any Elasticsearch memory from being swapped out. This can be done, by adding this line to the config/elasticsearch.yml file:
These are just your command line arguments that you have passed to the JVM. The output means nothing with regard to having the parameters applied successfully.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.