Elastic Search Increase RLIMIT_MEMLOCK (ulimit)

This can be caused be a resource limit on the Elasticsearch user. They are simply not allowed to lock that much memory. Change locked memory size in the host by Edit the file /etc/security/limits.conf

$ sudo vi /etc/security/limits.conf

Add the following line at the end of the file to set an unlimited locked memory for the user named “user1”. The second field value can be “hard” or “soft”: “hard” enforces the resource limit, and “soft” defines the default value within the maximum value specified by “hard”.

user1    hard   memlock           unlimited
user1    soft    memlock           unlimited

By adding this, user1 can raise the locked memory size without limit. To allow all users to set unlimited memlock, simply replace user1 with the wildcard *

*            hard   memlock           unlimited
*            soft    memlock           unlimited

Reboot the system. Login and verify that the locked memory is now set to unlimited:

$ ulimit –l
unlimited