GetTotalSwapSpaceSize is not available – How to solve this Elasticsearch error

Opster Team

Aug-23, Version: 6.8-8.9

Briefly, this error occurs when Elasticsearch is unable to access the total swap space size on your system. This could be due to restrictions in the operating system or JVM configurations. To resolve this issue, you can disable the bootstrap checks by setting the “discovery.type” to “single-node” in the Elasticsearch configuration file. Alternatively, you can enable the JVM to access the total swap space size by adjusting the JVM settings or system permissions. Please note that disabling bootstrap checks should only be done in a development environment and not in production.

This guide will help you check for common problems that cause the log ” getTotalSwapSpaceSize is not available ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: monitor.

Log Context

Log “getTotalSwapSpaceSize is not available” classname is OsProbe.java.
We extracted the following from Elasticsearch source code for those seeking an in-depth context :

    /**
     * Returns the total amount of swap space in bytes.
     */
    public long getTotalSwapSpaceSize() {
        if (getTotalSwapSpaceSize == null) {
            logger.warn("getTotalSwapSpaceSize is not available");
            return 0;
        }
        try {
            final long mem = (long) getTotalSwapSpaceSize.invoke(osMxBean);
            if (mem 


 

 [ratemypost]