Class StableMasterHealthIndicatorService

java.lang.Object
org.elasticsearch.cluster.coordination.StableMasterHealthIndicatorService
All Implemented Interfaces:
HealthIndicatorService

public class StableMasterHealthIndicatorService extends Object implements HealthIndicatorService
This indicator reports the health of master stability. If we have had a master within the last 30 seconds, and that master has not changed more than 3 times in the last 30 minutes, then this will report GREEN. If we have had a master within the last 30 seconds, but that master has changed more than 3 times in the last 30 minutes (and that is confirmed by checking with the last-known master), then this will report YELLOW. If we have not had a master within the last 30 seconds, then this will will report RED with one exception. That exception is when: (1) no node is elected master, (2) this node is not master eligible, (3) some node is master eligible, (4) we ask a master-eligible node to run this indicator, and (5) it comes back with a result that is not RED. Since this indicator needs to be able to run when there is no master at all, it does not depend on the dedicated health node (which requires the existence of a master).
  • Field Details

  • Constructor Details

  • Method Details

    • name

      public String name()
      Specified by:
      name in interface HealthIndicatorService
    • isPreflight

      public boolean isPreflight()
      Description copied from interface: HealthIndicatorService
      A preflight indicator is an indicator that is run first and represents a serious cascading health problem. For example, the `stable_master` health indicator is a preflight indicator. When it is red it means that the node has witnessed too many master nodes which could mean there are missing nodes, or a discovery problem, or that the node itself has problems joining the elected master. For these reasons, it likely that the cluster state is not up-to-date enough for us to make health decisions off of it.
      Specified by:
      isPreflight in interface HealthIndicatorService
      Returns:
      true if this is a preflight indicator, false otherwise.
    • calculate

      public HealthIndicatorResult calculate(boolean verbose, int maxAffectedResourcesCount, HealthInfo healthInfo)
      Specified by:
      calculate in interface HealthIndicatorService