Why is mlockall setting failing on Elasticsearch?


According to the elasticsearch.yml:

bootstrap.mlockall: true

But according to ES when queried they are all false.

curl '; | grep mlockall 
 "mlockall" : false 
 "mlockall" : false 
 "mlockall" : false 
 "mlockall" : false 
 "mlockall" : false 

Which is correct? Maybe a bug?


If you see that mlockall is false, then it means that the the mlockall request has failed. The most probable reason is that the user running Elasticsearch doesn’t have permission to lock memory. This can be granted by running

ulimit -l unlimited

as root before starting Elasticsearch.

Another possible reason why mlockall can fail is that the temporary directory (usually /tmp) is mounted with the noexec option. This can be solved by specfying a new temp directory, by starting Elasticsearch with:

./bin/elasticsearch -Djna.tmpdir=/path/to/new/dir
1 Like