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

Opster Team

Aug-23, Version: 5-5

Briefly, this error occurs when Elasticsearch attempts to allocate a shard to a node, but doing so would leave the node with less than the required disk space. 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 your nodes, delete unnecessary data to free up space, or adjust the “cluster.routing.allocation.disk.watermark.low” and “cluster.routing.allocation.disk.watermark.high” settings to allow more disk usage. However, be cautious as allowing too much disk usage can lead to performance issues.

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

Log Context

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

// Secondly; check that allocating the shard to this node doesn't put it above the high watermark
        final long shardSize = getExpectedShardSize(shardRouting; allocation; 0);
        double freeSpaceAfterShard = freeDiskPercentageAfterShardAssigned(usage; shardSize);
        long freeBytesAfterShard = freeBytes - shardSize;
        if (freeBytesAfterShard 

 

 [ratemypost]