After allocating node would have less than the required free bytes threshold bytes free preventing allocation – How to solve this Elasticsearch error

Opster Team

Aug-23, Version: 2.3-2.3

Briefly, this error occurs when Elasticsearch tries to allocate shards to a node, but the node doesn’t have enough free space. Elasticsearch has a disk watermark setting that prevents shard allocation if it would leave less free space than the threshold. To resolve this, you can either increase the disk space on the node, delete unnecessary data to free up space, or adjust the disk watermark settings to allow more disk usage. However, be cautious with the last option as it could lead to disk space issues in the future.

This guide will help you check for common problems that cause the log ” after allocating; node [{}] would have less than the required {} free bytes threshold ({} bytes free); preventing allocation ” 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 {} free bytes threshold ({} bytes free); preventing allocation” classname is DiskThresholdDecider.java.
We extracted the following from Elasticsearch source code for those seeking an in-depth context :

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
// Secondly; check that allocating the shard to this node doesn't put it above the high watermark
final long shardSize = getShardSize(shardRouting; allocation.clusterInfo());
double freeSpaceAfterShard = freeDiskPercentageAfterShardAssigned(usage; shardSize);
long freeBytesAfterShard = freeBytes - shardSize;
if (freeBytesAfterShard
<p> </p>
<p> [ratemypost]</p>
// Secondly; check that allocating the shard to this node doesn't put it above the high watermark final long shardSize = getShardSize(shardRouting; allocation.clusterInfo()); double freeSpaceAfterShard = freeDiskPercentageAfterShardAssigned(usage; shardSize); long freeBytesAfterShard = freeBytes - shardSize; if (freeBytesAfterShard <p> </p> <p> [ratemypost]</p>
         // Secondly; check that allocating the shard to this node doesn't put it above the high watermark
        final long shardSize = getShardSize(shardRouting; allocation.clusterInfo());
        double freeSpaceAfterShard = freeDiskPercentageAfterShardAssigned(usage; shardSize);
        long freeBytesAfterShard = freeBytes - shardSize;
        if (freeBytesAfterShard 

 

 [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.