esasg

package module
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

README

elasticsearch-asg

Build Status GoDoc GitHub

A number of little tools I needed setting up Elasticsearch as AWS Autoscaling Groups. These target Elasticsearch >= 7.0.

  • cloudwatcher - Push metrics about Elasticsearch cluster to AWS CloudWatch, mainly for autoscaling.
  • healthcheck - Provide health and readiness checks for Elasticsearch.
  • lifecycler - Regulate AWS Autoscaling of Elasticsearch by delaying new autoscaling actions until cluster is stable.
  • snapshooter - Take snapshots of Elasticsearch cluster on a schedule, and clean up old ones.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInconsistentNodes = errors.New("got inconsistent nodes from Elasticsearch")

ErrInconsistentNodes is returned when ElasticsearchQueryService.Nodes() gets different sets of nodes from Elasticsearch across API calls.

Functions

This section is empty.

Types

type ElasticsearchCommandService

type ElasticsearchCommandService struct {
	// contains filtered or unexported fields
}

ElasticsearchCommandService implements methods that write to Elasticsearch endpoints.

func NewElasticsearchCommandService

func NewElasticsearchCommandService(client *elastic.Client) *ElasticsearchCommandService

NewElasticsearchCommandService returns a new ElasticsearchCommandService.

func (*ElasticsearchCommandService) Drain

func (s *ElasticsearchCommandService) Drain(ctx context.Context, nodeName string) error

Drain excludes a node from shard allocation, which will cause Elasticsearch to remove shards from the node until empty.

See: https://www.elastic.co/guide/en/elasticsearch/reference/7.0/allocation-filtering.html

func (*ElasticsearchCommandService) Undrain

func (s *ElasticsearchCommandService) Undrain(ctx context.Context, nodeName string) error

Undrain reverses Drain.

See: https://www.elastic.co/guide/en/elasticsearch/reference/7.0/allocation-filtering.html

type ElasticsearchQueryService

type ElasticsearchQueryService struct {
	// contains filtered or unexported fields
}

ElasticsearchQueryService implements methods that read from Elasticsearch endpoints.

func NewElasticsearchQueryService

func NewElasticsearchQueryService(client *elastic.Client) *ElasticsearchQueryService

NewElasticsearchQueryService returns a new ElasticsearchQueryService.

func (*ElasticsearchQueryService) Node

func (s *ElasticsearchQueryService) Node(ctx context.Context, name string) (*Node, error)

Node returns a single node with the given name. Will return nil if the node doesn't exist.

func (*ElasticsearchQueryService) Nodes

func (s *ElasticsearchQueryService) Nodes(ctx context.Context, names ...string) (map[string]*Node, error)

Nodes returns info and stats about the nodes in the Elasticsearch cluster, as a map from node name to Node. If names are past, limit to nodes with those names. It's left up to the caller to check if all the names are in the response.

type Node

type Node struct {
	elastic.NodesInfoNode

	ClusterName             string
	ElectedMaster           bool
	ExcludedShardAllocation bool
	Stats                   elastic.NodesStatsNode
	Shards                  es.CatShardsResponse
}

Node represents info and stats about an Elasticsearch node at a point in time.

func (*Node) Indices

func (n *Node) Indices() []string

Indices returns list of of index names present on this shard.

Directories

Path Synopsis
cmd
pkg
es
Package es implements additional services that are missing from https://github.com/olivere/elastic .
Package es implements additional services that are missing from https://github.com/olivere/elastic .
es/health
Package health implements Elasticsearch healthchecks (using https://github.com/heptiolabs/healthcheck) to check the liveness and readiness of an Elasticsearch node.
Package health implements Elasticsearch healthchecks (using https://github.com/heptiolabs/healthcheck) to check the liveness and readiness of an Elasticsearch node.
lifecycle
Package lifecycle impelmments unmarshaling of AWS Autoscaling Group Lifecycle Hook event messages, and provides a function KeepAlive() that will keep an event in the Transition:Wait state until a function returns true.
Package lifecycle impelmments unmarshaling of AWS Autoscaling Group Lifecycle Hook event messages, and provides a function KeepAlive() that will keep an event in the Transition:Wait state until a function returns true.
squeues
Package squeues implements a concurrent dispatcher for AWS SQS queue messages.
Package squeues implements a concurrent dispatcher for AWS SQS queue messages.
str
Package str contains string utilities.
Package str contains string utilities.
time
Package time implements time stuff.
Package time implements time stuff.

Jump to

Keyboard shortcuts

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