Briefly, this error occurs when Elasticsearch is unable to access Java Native Access (JNA), which is a library that provides Java programs easy access to native shared libraries. This could be due to incorrect installation or configuration of JNA. To resolve this issue, you can try reinstalling or updating JNA. Alternatively, check your Java environment and ensure it’s correctly configured. Also, ensure that Elasticsearch has the necessary permissions to access the JNA library.
This guide will help you check for common problems that cause the log ” cannot check if running as root because JNA is not available ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: bootstrap.
Log Context
Log “cannot check if running as root because JNA is not available” classname is Natives.java.
We extracted the following from Elasticsearch source code for those seeking an in-depth context :
JNANatives.tryMlockall(); } static boolean definitelyRunningAsRoot() { if (JNA_AVAILABLE == false) { logger.warn("cannot check if running as root because JNA is not available"); return false; } return JNANatives.definitelyRunningAsRoot(); }