Error Log: This is a critical error that appears in your opensearch.log file on node startup, and it will prevent the node from starting.
None
[ERROR][o.o.b.BootstrapChecks] [your-node-name]
memory locking requested for OpenSearch process but memory is not locked.
This can result in part of the JVM heap being swapped out.
Increase RLIMIT_MEMLOCK (ulimit -l).
Why… is this happening? You (or your administrator) have set bootstrap.memory_lock: true in your opensearch.yml configuration file.
This is a highly recommended production setting. It tells OpenSearch to ask the operating system to “lock” its JVM heap into physical RAM, preventing it from ever being “swapped” to the much slower disk. If the JVM heap gets swapped, it can cause extremely long garbage collection pauses and severe cluster instability.
This error means: “You asked me to lock the memory, but the operating system denied my request.”
The OS denies the request because the opensearch user does not have the necessary permissions (ulimit -l unlimited) to lock memory.
Best Practice: You must grant the OpenSearch user the memlock permission. The method depends on how you installed OpenSearch.
1. For systemd (RPM/Deb installs):
- Create an override file:
sudo systemctl edit opensearch. - Add the following lines to the file:
Ini, TOML
None
[Service]
LimitMEMLOCK=infinity
Save the file, then run: Bash
None
sudo systemctl daemon-reload
sudo systemctl restart opensearch
2. For tarball installs (or non-systemd init):
Edit the /etc/security/limits.conf file.
Add this line (replace opensearch with your user if different):
None
opensearch - memlock unlimited
- Save the file. You must log out and log back in as the
opensearchuser for this change to take effect before restarting the process.
To Verify the Fix: After restarting, run this command. If it returns true, you’re all set! GET _nodes?filter_path=nodes.*.process.mlockall
What else can I do? Confused about ulimit settings or which method to use for your operating system? This is a common setup hurdle. Ask the OpenSearch community, or contact us for help with your production setup in The OpenSearch Slack Channel in #General.