Class ShardsLimitAllocationDecider
java.lang.Object
org.elasticsearch.cluster.routing.allocation.decider.AllocationDecider
org.elasticsearch.cluster.routing.allocation.decider.ShardsLimitAllocationDecider
This
AllocationDecider limits the number of shards per node on a per
index or node-wide basis. The allocator prevents a single node to hold more
than index.routing.allocation.total_shards_per_node per index and
cluster.routing.allocation.total_shards_per_node globally during the allocation
process. The limits of this decider can be changed in real-time via a the
index settings API.
If index.routing.allocation.total_shards_per_node is reset to a negative value shards
per index are unlimited per node. Shards currently in the
relocating state are ignored by this
AllocationDecider until the shard changed its state to either
started,
inializing or
unassigned
Note: Reducing the number of shards per node via the index update API can trigger relocation and significant additional load on the clusters nodes.
-
Field Summary
FieldsModifier and TypeFieldDescriptionControls the maximum number of shards per node on a global level.Controls the maximum number of shards per index on a single Elasticsearch node.static String -
Constructor Summary
ConstructorsConstructorDescriptionShardsLimitAllocationDecider(Settings settings, ClusterSettings clusterSettings) -
Method Summary
Modifier and TypeMethodDescriptioncanAllocate(ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation)Returns aDecisionwhether the given shard routing can be allocated on the given node.canRemain(ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation)Returns aDecisionwhether the given shard routing can be remain on the given node.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
-
INDEX_TOTAL_SHARDS_PER_NODE_SETTING
Controls the maximum number of shards per index on a single Elasticsearch node. Negative values are interpreted as unlimited. -
CLUSTER_TOTAL_SHARDS_PER_NODE_SETTING
Controls the maximum number of shards per node on a global level. Negative values are interpreted as unlimited.
-
-
Constructor Details
-
ShardsLimitAllocationDecider
-
-
Method Details
-
canAllocate
public Decision canAllocate(ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation)Description copied from class:AllocationDeciderReturns aDecisionwhether the given shard routing can be allocated on the given node. The default isDecision.ALWAYS.- Overrides:
canAllocatein classAllocationDecider
-
canRemain
public Decision canRemain(ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation)Description copied from class:AllocationDeciderReturns aDecisionwhether the given shard routing can be remain on the given node. The default isDecision.ALWAYS.- Overrides:
canRemainin classAllocationDecider
-