health

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 7, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package health implements Elasticsearch healthchecks (using https://github.com/heptiolabs/healthcheck) to check the liveness and readiness of an Elasticsearch node.

Index

Constants

This section is empty.

Variables

View Source
var DefaultHTTPTimeout = 30 * time.Second

DefaultHTTPTimeout is the default timeout for sending HTTP requests to Elasticsearch.

Functions

func CheckLiveHEAD

func CheckLiveHEAD(URL string) healthcheck.Check

CheckLiveHEAD checks if a HEAD request to / returns 200.

func CheckReadyJoinedCluster

func CheckReadyJoinedCluster(url string) healthcheck.Check

CheckReadyJoinedCluster checks if a Elasticsearch node has joined a cluster.

func CheckReadyRollingUpgrade

func CheckReadyRollingUpgrade(url string) healthcheck.Check

CheckReadyRollingUpgrade checks that Elasticsearch has recovered from a rolling upgrade.

The purpose of this check is to prevent the rolling upgrade from proceeding. Most deployment systems have some concept of a healthcheck grace period where a failing health check is ignored for some period of time during startup. The rolling upgrade usually won't proceed until the healthcheck starts passing.

The check fails for one of two reasons:

  1. Index shards on this node are in the INITIALIZING state. Only shards that are present when the check first runs are considered in future runs. That way any newly created indices/shards in the INITIALIZING state won't interrupt node startup. (Really, you should try not to write to Elasticsearch when doing an upgrade.)
  2. Any shard in the cluster is in a RELOCATING state. The rolling upgrade should not proceed while shards are being moved around due to the danger of data loss.

After the check passes for the first time, it will always pass on every subsequent call.

See: https://www.elastic.co/guide/en/elasticsearch/reference/7.0/rolling-upgrades.html

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL