Memory locking requested for elasticsearch process but memory is not locked

elasticsearchjvm

ElasticSearch 5.6.7 throws somewhat misleading following error and refuse to start:

[2018-08-02T10:07:50,333][ERROR][o.e.b.Bootstrap          ] [esm56n3] node validation exception
[2] bootstrap checks failed
[1]: memory locking requested for elasticsearch process but memory is not locked
[2]: system call filters failed to install; check the logs and fix your configuration or disable system call filters at your own risk

What are possible causes?

Best Answer

Responding to my own question. Assuming that all set from OS limits point of view, it could also be that your "/tmp" containing partition missing "exec" option. You have several options to correct it and start elasticsearch process here:

  1. fix your /etc/fstab to remove noexec from /tmp containing partition and run mount -oremount
  2. just a run-time fix by enabling exec option: mount -oremount,exec
  3. Add the following option to elasticsearch jvm config (jvm.options) to point to partition with exec capabilities: -Djava.io.tmpdir=/path/to/temp/dir

Then go ahead and restart your elasticsearch systemctl daemon (you do not run it on CentOS < 7, do you? :-) More details here.