Class DiskThresholdDecider
java.lang.Object
org.elasticsearch.cluster.routing.allocation.decider.AllocationDecider
org.elasticsearch.cluster.routing.allocation.decider.DiskThresholdDecider
The
DiskThresholdDecider
checks that the node a shard is potentially
being allocated to has enough disk space.
It has three configurable settings, all of which can be changed dynamically:
cluster.routing.allocation.disk.watermark.low
is the low disk
watermark. New shards will not allocated to a node with usage higher than this,
although this watermark may be passed by allocating a shard. It defaults to
0.85 (85.0%).
cluster.routing.allocation.disk.watermark.high
is the high disk
watermark. If a node has usage higher than this, shards are not allowed to
remain on the node. In addition, if allocating a shard to a node causes the
node to pass this watermark, it will not be allowed. It defaults to
0.90 (90.0%).
Both watermark settings are expressed in terms of used disk percentage, or
exact byte values for free space (like "500mb")
cluster.routing.allocation.disk.threshold_enabled
is used to
enable or disable this decider. It defaults to true (enabled).-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncanAllocate(ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation)
Returns aDecision
whether the given shard routing can be allocated on the given node.canRemain(ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation)
Returns aDecision
whether the given shard routing can be remain on the given node.static long
getExpectedShardSize(ShardRouting shard, long defaultValue, ClusterInfo clusterInfo, SnapshotShardSizeInfo snapshotShardSizeInfo, Metadata metadata, RoutingTable routingTable)
Returns the expected shard size for the given shard or the default value provided if not enough information are available to estimate the shards size.static long
sizeOfRelocatingShards(RoutingNode node, boolean subtractShardsMovingAway, String dataPath, ClusterInfo clusterInfo, Metadata metadata, RoutingTable routingTable)
Returns the size of all shards that are currently being relocated to the node, but may not be finished transferring yet.Methods inherited from class org.elasticsearch.cluster.routing.allocation.decider.AllocationDecider
canAllocate, canAllocate, canForceAllocatePrimary, canRebalance, canRebalance, shouldAutoExpandToNode
-
Field Details
-
NAME
- See Also:
- Constant Field Values
-
ENABLE_FOR_SINGLE_DATA_NODE
-
SETTING_IGNORE_DISK_WATERMARKS
-
-
Constructor Details
-
DiskThresholdDecider
-
-
Method Details
-
sizeOfRelocatingShards
public static long sizeOfRelocatingShards(RoutingNode node, boolean subtractShardsMovingAway, String dataPath, ClusterInfo clusterInfo, Metadata metadata, RoutingTable routingTable)Returns the size of all shards that are currently being relocated to the node, but may not be finished transferring yet. If subtractShardsMovingAway is true then the size of shards moving away is subtracted from the total size of all shards -
canAllocate
public Decision canAllocate(ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation)Description copied from class:AllocationDecider
Returns aDecision
whether the given shard routing can be allocated on the given node. The default isDecision.ALWAYS
.- Overrides:
canAllocate
in classAllocationDecider
-
canRemain
public Decision canRemain(ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation)Description copied from class:AllocationDecider
Returns aDecision
whether the given shard routing can be remain on the given node. The default isDecision.ALWAYS
.- Overrides:
canRemain
in classAllocationDecider
-
getExpectedShardSize
public static long getExpectedShardSize(ShardRouting shard, long defaultValue, ClusterInfo clusterInfo, SnapshotShardSizeInfo snapshotShardSizeInfo, Metadata metadata, RoutingTable routingTable)Returns the expected shard size for the given shard or the default value provided if not enough information are available to estimate the shards size.
-