Module org.elasticsearch.server
Class StatefulShardsAvailabilityHealthIndicatorService
java.lang.Object
org.elasticsearch.cluster.routing.allocation.shards.ShardsAvailabilityHealthIndicatorService
org.elasticsearch.cluster.routing.allocation.shards.StatefulShardsAvailabilityHealthIndicatorService
- All Implemented Interfaces:
HealthIndicatorService
public class StatefulShardsAvailabilityHealthIndicatorService
extends ShardsAvailabilityHealthIndicatorService
implements HealthIndicatorService
This indicator reports health for shards.
Indicator will report: * RED when one or more primary shards are not available * YELLOW when one or more replica shards are not available * GREEN otherwise
Each shard needs to be available and replicated in order to guarantee high availability and prevent data loses. Shards allocated on nodes scheduled for restart (using nodes shutdown API) will not degrade this indicator health.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassNested classes/interfaces inherited from class org.elasticsearch.cluster.routing.allocation.shards.ShardsAvailabilityHealthIndicatorService
ShardsAvailabilityHealthIndicatorService.SearchableSnapshotsState, ShardsAvailabilityHealthIndicatorService.ShardAllocationCounts, ShardsAvailabilityHealthIndicatorService.ShardAllocationStatus -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Map<String, Diagnosis.Definition> static final Diagnosis.Definitionstatic final Map<String, Diagnosis.Definition> static final Diagnosis.Definitionstatic final Map<String, Diagnosis.Definition> static final StringFields inherited from class org.elasticsearch.cluster.routing.allocation.shards.ShardsAvailabilityHealthIndicatorService
ACTION_CHECK_ALLOCATION_EXPLAIN_API, ACTION_ENABLE_CLUSTER_ROUTING_ALLOCATION, ACTION_ENABLE_INDEX_ROUTING_ALLOCATION, ACTION_INCREASE_NODE_CAPACITY, ACTION_INCREASE_SHARD_LIMIT_CLUSTER_SETTING, ACTION_INCREASE_SHARD_LIMIT_INDEX_SETTING, ACTION_RESTORE_FROM_SNAPSHOT, clusterService, DIAGNOSE_SHARDS_ACTION_GUIDE, DIAGNOSIS_WAIT_FOR_INITIALIZATION, DIAGNOSIS_WAIT_FOR_OR_FIX_DELAYED_SHARDS, ENABLE_CLUSTER_ALLOCATION_ACTION_GUIDE, ENABLE_INDEX_ALLOCATION_GUIDE, ENABLE_TIER_ACTION_GUIDE, FIX_DELAYED_SHARDS_GUIDE, INCREASE_CLUSTER_SHARD_LIMIT_ACTION_GUIDE, INCREASE_SHARD_LIMIT_ACTION_GUIDE, NAME, PRIMARY_UNASSIGNED_IMPACT_ID, projectResolver, READ_ONLY_PRIMARY_UNASSIGNED_IMPACT_ID, REPLICA_UNASSIGNED_BUFFER_TIME, REPLICA_UNASSIGNED_IMPACT_ID, RESTORE_FROM_SNAPSHOT_ACTION_GUIDE, TIER_CAPACITY_ACTION_GUIDE, WAIT_FOR_INITIALIZATION_GUIDEFields inherited from interface org.elasticsearch.health.HealthIndicatorService
MAX_AFFECTED_RESOURCES_COUNT -
Constructor Summary
ConstructorsConstructorDescriptionStatefulShardsAvailabilityHealthIndicatorService(ClusterService clusterService, AllocationService allocationService, SystemIndices systemIndices, ProjectResolver projectResolver) -
Method Summary
Modifier and TypeMethodDescriptionprotected List<Diagnosis.Definition> checkNodeRoleRelatedIssues(IndexMetadata indexMetadata, List<NodeAllocationResult> nodeAllocationResults, ClusterState clusterState, ShardRouting shardRouting) Generates a list of diagnoses for common problems that keep a shard from allocating to nodes depending on their role; a very common example of such a case are data tiers.createNewStatus(Metadata metadata, int maxAffectedResourcesCount) Creates a newShardsAvailabilityHealthIndicatorService.ShardAllocationStatusthat will be used to track primary and replica availability, providing the color, diagnosis, and messages about the available or unavailable shards in the cluster.Methods inherited from class org.elasticsearch.cluster.routing.allocation.shards.ShardsAvailabilityHealthIndicatorService
calculate, checkNodesWithRoleAtShardLimit, checkNotEnoughNodesWithRole, hasDeciderResult, nameMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.elasticsearch.health.HealthIndicatorService
calculate, calculate, createIndicator, isPreflight, name
-
Field Details
-
MIGRATE_TO_TIERS_ACTION_GUIDE
- See Also:
-
ACTION_MIGRATE_TIERS_AWAY_FROM_REQUIRE_DATA
-
ACTION_MIGRATE_TIERS_AWAY_FROM_REQUIRE_DATA_LOOKUP
public static final Map<String,Diagnosis.Definition> ACTION_MIGRATE_TIERS_AWAY_FROM_REQUIRE_DATA_LOOKUP -
ACTION_MIGRATE_TIERS_AWAY_FROM_INCLUDE_DATA
-
ACTION_MIGRATE_TIERS_AWAY_FROM_INCLUDE_DATA_LOOKUP
public static final Map<String,Diagnosis.Definition> ACTION_MIGRATE_TIERS_AWAY_FROM_INCLUDE_DATA_LOOKUP -
ACTION_INCREASE_TIER_CAPACITY_LOOKUP
-
-
Constructor Details
-
StatefulShardsAvailabilityHealthIndicatorService
public StatefulShardsAvailabilityHealthIndicatorService(ClusterService clusterService, AllocationService allocationService, SystemIndices systemIndices, ProjectResolver projectResolver)
-
-
Method Details
-
createNewStatus
public ShardsAvailabilityHealthIndicatorService.ShardAllocationStatus createNewStatus(Metadata metadata, int maxAffectedResourcesCount) Description copied from class:ShardsAvailabilityHealthIndicatorServiceCreates a newShardsAvailabilityHealthIndicatorService.ShardAllocationStatusthat will be used to track primary and replica availability, providing the color, diagnosis, and messages about the available or unavailable shards in the cluster.- Specified by:
createNewStatusin classShardsAvailabilityHealthIndicatorService- Parameters:
metadata- Metadata for the clustermaxAffectedResourcesCount- Max number of affect resources to return- Returns:
- A new ShardAllocationStatus that has not yet been filled.
-
checkNodeRoleRelatedIssues
protected List<Diagnosis.Definition> checkNodeRoleRelatedIssues(IndexMetadata indexMetadata, List<NodeAllocationResult> nodeAllocationResults, ClusterState clusterState, ShardRouting shardRouting) Generates a list of diagnoses for common problems that keep a shard from allocating to nodes depending on their role; a very common example of such a case are data tiers.- Specified by:
checkNodeRoleRelatedIssuesin classShardsAvailabilityHealthIndicatorService- Parameters:
indexMetadata- Index metadata for the shard being diagnosed.nodeAllocationResults- allocation decision results for all nodes in the cluster.clusterState- the current cluster state.shardRouting- the shard the nodeAllocationResults refer to- Returns:
- A list of diagnoses for the provided unassigned shard
-
getAddNodesWithRoleAction
- Specified by:
getAddNodesWithRoleActionin classShardsAvailabilityHealthIndicatorService
-
getIncreaseShardLimitIndexSettingAction
- Specified by:
getIncreaseShardLimitIndexSettingActionin classShardsAvailabilityHealthIndicatorService
-
getIncreaseShardLimitClusterSettingAction
- Specified by:
getIncreaseShardLimitClusterSettingActionin classShardsAvailabilityHealthIndicatorService
-
getIncreaseNodeWithRoleCapacityAction
- Specified by:
getIncreaseNodeWithRoleCapacityActionin classShardsAvailabilityHealthIndicatorService
-