ElasticSearch

Introduction

The Elasticsearch clusters in Workarea environments run in a three node, sharded replica set.

All elasticsearch nodes in a VPC sit behind an internal ELB.

If an elasticsearch cluster cannot is missing a primary shard but has a secondary for it, the cluster status will be yellow. If an elasticsearch cluster cannot find a primary or secondary for any of it's shards, the cluster status will be red.

Querying for Elasticsearch cluster status

On Workarea v2 or less, you can find the elasticsearch ELB url in config/secrets.yml. On Workarea v3 or higher environments, the elasticsearch ELB url is stored in an environment variable, WORKAREA_ELASTICSEARCH_URL.

Given an elasticsearch url of http://internal-es-prv-myclient-staging-20663.us-east-1.elb.amazonaws.com, you can use curl from any of the app or elasticsearch instances in your environment to query for the status:

$ curl http://internal-es-prv-myclient-staging-20663.us-east-1.elb.amazonaws.com:9200/_cluster/health?pretty

{
  "cluster_name" : "myclient-staging-elasticsearch",
  "status" : "green",
  "timed_out" : false,
  "number_of_nodes" : 3,
  "number_of_data_nodes" : 3,
  "active_primary_shards" : 39,
  "active_shards" : 78,
  "relocating_shards" : 0,
  "initializing_shards" : 0,
  "unassigned_shards" : 0,
  "delayed_unassigned_shards" : 0,
  "number_of_pending_tasks" : 0,
  "number_of_in_flight_fetch" : 0
}

Elasticsearch versions for Workarea

Workarea Version Elasticsearch Version Docs
v1 or earlier v0.90 ES V0.90 Docs
v2 v1.7.6 ES v1.7.6 docs
v3 v5.2.2 ES v5.2.2 docs