After allocating node would have less than the required threshold of – How to solve this Elasticsearch error

Opster Team

Aug-23, Version: 6.8-7.15

Briefly, this error occurs when Elasticsearch attempts to allocate a shard to a node, but doing so would leave the node with less free disk space than the set threshold. This is a safeguard to prevent nodes from running out of disk space. To resolve this issue, you can either increase the disk space available on the node, decrease the amount of data stored on the node by deleting unnecessary indices or shards, or adjust the disk watermark thresholds in the Elasticsearch settings to allow more disk space to be used before triggering this error.

This guide will help you check for common problems that cause the log ” after allocating [{}] node [{}] would have less than the required threshold of ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: allocation, node, threshold, routing, cluster.

Log Context

Log “after allocating [{}] node [{}] would have less than the required threshold of ” classname is DiskThresholdDecider.java.
We extracted the following from Elasticsearch source code for those seeking an in-depth context :

            allocation.clusterInfo(); allocation.snapshotShardSizeInfo(); allocation.metadata(); allocation.routingTable());
        assert shardSize >= 0 : shardSize;
        double freeSpaceAfterShard = freeDiskPercentageAfterShardAssigned(usage; shardSize);
        long freeBytesAfterShard = freeBytes - shardSize;
        if (freeBytesAfterShard < diskThresholdSettings.getFreeBytesThresholdHigh().getBytes()) {
            logger.warn("after allocating [{}] node [{}] would have less than the required threshold of " +
                    "{} free (currently {} free; estimated shard size is {}); preventing allocation"; shardRouting;
                    node.nodeId(); diskThresholdSettings.getFreeBytesThresholdHigh(); freeBytesValue; new ByteSizeValue(shardSize));
            return allocation.decision(Decision.NO; NAME;
                "allocating the shard to this node will bring the node above the high watermark cluster setting [%s=%s] " +
                    "and cause it to have less than the minimum required [%s] of free space (free: [%s]; estimated shard size: [%s])";

 

 [ratemypost]

Opster
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.