public class ShardsLimitAllocationDecider extends AllocationDecider
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.
Modifier and Type | Field and Description |
---|---|
static String |
CLUSTER_TOTAL_SHARDS_PER_NODE
Controls the maximum number of shards per node on a global level.
|
static String |
INDEX_TOTAL_SHARDS_PER_NODE
Controls the maximum number of shards per index on a single Elasticsearch
node.
|
static String |
NAME |
deprecationLogger, logger, settings
Constructor and Description |
---|
ShardsLimitAllocationDecider(Settings settings,
NodeSettingsService nodeSettingsService) |
Modifier and Type | Method and Description |
---|---|
Decision |
canAllocate(RoutingNode node,
RoutingAllocation allocation)
Returns a
Decision whether the given node can allow any allocation at all at this state of the
RoutingAllocation . |
Decision |
canAllocate(ShardRouting shardRouting,
RoutingNode node,
RoutingAllocation allocation)
Returns a
Decision whether the given shard routing can be
allocated on the given node. |
Decision |
canRemain(ShardRouting shardRouting,
RoutingNode node,
RoutingAllocation allocation)
Returns a
Decision whether the given shard routing can be remain
on the given node. |
canAllocate, canAllocate, canRebalance, canRebalance
logDeprecatedSetting, logRemovedSetting, nodeName
public static final String NAME
public static final String INDEX_TOTAL_SHARDS_PER_NODE
public static final String CLUSTER_TOTAL_SHARDS_PER_NODE
@Inject public ShardsLimitAllocationDecider(Settings settings, NodeSettingsService nodeSettingsService)
public Decision canAllocate(ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation)
AllocationDecider
Decision
whether the given shard routing can be
allocated on the given node. The default is Decision.ALWAYS
.canAllocate
in class AllocationDecider
public Decision canRemain(ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation)
AllocationDecider
Decision
whether the given shard routing can be remain
on the given node. The default is Decision.ALWAYS
.canRemain
in class AllocationDecider
public Decision canAllocate(RoutingNode node, RoutingAllocation allocation)
AllocationDecider
Decision
whether the given node can allow any allocation at all at this state of the
RoutingAllocation
. The default is Decision.ALWAYS
.canAllocate
in class AllocationDecider
Copyright © 2009–2016. All rights reserved.