Explain the shard allocations
- POST also GET /_cluster/allocation/explain
Get explanations for shard allocations in the cluster. This API accepts the current_node, index, primary and shard parameters in the request body or in query parameters, but not in both at the same time. For unassigned shards, it provides an explanation for why the shard is unassigned. For assigned shards, it provides an explanation for why the shard is remaining on its current node and has not moved or rebalanced to another node. This API can be very useful when attempting to diagnose why a shard is unassigned or why a shard continues to remain on its current node when you might expect otherwise. Refer to the linked documentation for examples of how to troubleshoot allocation issues using this API.
Cluster allocation API examplesQuery Parameters
-
indexstring IndexName The name of the index that you would like an explanation for.
-
shardnumber An identifier for the shard that you would like an explanation for.
-
primaryboolean If true, returns an explanation for the primary shard for the specified shard ID.
-
current_nodestring Explain a shard only if it is currently located on the specified node name or node ID.
-
include_disk_infoboolean · default: false If true, returns information about disk usage and shard sizes.
-
include_yes_decisionsboolean · default: false If true, returns YES decisions in explanation.
-
master_timeoutstring Duration · default: 30s Period to wait for a connection to the master node.
Request
-
indexstring IndexName -
The name of the index that you would like an explanation for.
-
shardnumber -
An identifier for the shard that you would like an explanation for.
-
primaryboolean -
If true, returns an explanation for the primary shard for the specified shard ID.
-
current_nodestring -
Explain a shard only if it is currently located on the specified node name or node ID.
Response
-
allocate_explanationstring -
allocation_delaystring Duration -
allocation_delay_in_millisDurationValueUnitMillis -
can_allocateDecision -
Values:
yesnoworse_balancethrottledawaiting_infoallocation_delayedno_valid_shard_copyno_attempt -
can_move_to_other_nodeDecision -
Values:
yesnoworse_balancethrottledawaiting_infoallocation_delayedno_valid_shard_copyno_attempt -
can_rebalance_clusterDecision -
Values:
yesnoworse_balancethrottledawaiting_infoallocation_delayedno_valid_shard_copyno_attempt -
can_rebalance_cluster_decisionsAllocationDecision -
deciderstringrequired -
decisionAllocationExplainDecisionrequired -
Values:
NOYESTHROTTLEALWAYS -
explanationstringrequired -
can_rebalance_to_other_nodeDecision -
Values:
yesnoworse_balancethrottledawaiting_infoallocation_delayedno_valid_shard_copyno_attempt -
can_remain_decisionsAllocationDecision -
deciderstringrequired -
decisionAllocationExplainDecisionrequired -
Values:
NOYESTHROTTLEALWAYS -
explanationstringrequired -
can_remain_on_current_nodeDecision -
Values:
yesnoworse_balancethrottledawaiting_infoallocation_delayedno_valid_shard_copyno_attempt -
cluster_infoClusterInfo -
nodesmap string to NodeDiskUsagerequired -
<string>NodeDiskUsage -
node_namestring Namerequired -
least_availableDiskUsagerequired -
pathstringrequired -
total_bytesnumberrequired -
used_bytesnumberrequired -
free_bytesnumberrequired -
free_disk_percentnumberrequired -
used_disk_percentnumberrequired -
most_availableDiskUsagerequired -
pathstringrequired -
total_bytesnumberrequired -
used_bytesnumberrequired -
free_bytesnumberrequired -
free_disk_percentnumberrequired -
used_disk_percentnumberrequired -
shard_sizesmap string to numberrequired -
shard_data_set_sizesmap string to string -
shard_pathsmap string to stringrequired -
reserved_sizesReservedSizerequired -
configured_delaystring Duration -
configured_delay_in_millisDurationValueUnitMillis -
current_nodeCurrentNode -
idstring Idrequired -
namestring Namerequired -
rolesNodeRolesrequired -
Values:
masterdatadata_colddata_contentdata_frozendata_hotdata_warmclientingestmlvoting_onlytransformremote_cluster_clientcoordinating_only -
attributesmap string to stringrequired -
transport_addressstringrequired -
weight_rankingnumberrequired -
current_statestringrequired -
indexstring IndexNamerequired -
move_explanationstring -
node_allocation_decisionsNodeAllocationExplanation -
decidersAllocationDecision -
deciderstringrequired -
decisionAllocationExplainDecisionrequired -
Values:
NOYESTHROTTLEALWAYS -
explanationstringrequired -
node_attributesmap string to stringrequired -
node_decisionDecisionrequired -
Values:
yesnoworse_balancethrottledawaiting_infoallocation_delayedno_valid_shard_copyno_attempt -
node_idstring Idrequired -
node_namestring Namerequired -
rolesNodeRolesrequired -
Values:
masterdatadata_colddata_contentdata_frozendata_hotdata_warmclientingestmlvoting_onlytransformremote_cluster_clientcoordinating_only -
storeAllocationStore -
allocation_idstringrequired -
foundbooleanrequired -
in_syncbooleanrequired -
matching_size_in_bytesnumberrequired -
matching_sync_idbooleanrequired -
store_exceptionstringrequired -
transport_addressstringrequired -
weight_rankingnumber -
primarybooleanrequired -
rebalance_explanationstring -
remaining_delaystring Duration -
remaining_delay_in_millisDurationValueUnitMillis -
shardnumberrequired -
unassigned_infoUnassignedInformation -
atDateTimerequired -
last_allocation_statusstring -
reasonUnassignedInformationReasonrequired -
Values:
INDEX_CREATEDCLUSTER_RECOVEREDINDEX_REOPENEDDANGLING_INDEX_IMPORTEDNEW_INDEX_RESTOREDEXISTING_INDEX_RESTOREDREPLICA_ADDEDALLOCATION_FAILEDNODE_LEFTREROUTE_CANCELLEDREINITIALIZEDREALLOCATED_REPLICAPRIMARY_FAILEDFORCED_EMPTY_PRIMARYMANUAL_ALLOCATION -
detailsstring -
failed_allocation_attemptsnumber -
delayedboolean -
allocation_statusstring -
notestring