elasticsearch
#34

Description

Elasticsearch is a search server based on Lucene. It provides a
distributed, multitenant-capable full-text search engine with a
RESTful web interface and schema-free JSON documents. This package
contains the infrastructure needed to an ElasticSearch node.

Overview

Elasticsearch is a flexible and powerful open source, distributed, real-time
search and analytics engine. Architected from the ground up for use in
distributed environments where reliability and scalability are must haves,
Elasticsearch gives you the ability to move easily beyond simple full-text
search. Through its robust set of APIs and query DSLs, plus clients for the
most popular programming languages, Elasticsearch delivers on the near
limitless promises of search technology.

Usage

This charm can be used to deploy Elasticsearch in any way that is suppored by upstream Elasticsearch, and then some.

The charm configuration exposes an option called node-type, which is used by the charm to know what type of
Elasticsearch node to configure. In order to orchestrate this charm to facilitate more complex deployments,
you must configure the node-type on a per application basis.

The options for the node-type config can be explained as follows:

all - The node will assume all roles of Elasticsearch, there will be no difference in configuration from one node to the next.

master - The node will assume the 'master' node-type. Master nodes will wait for the number of peers to be >= the charm configuration
option minn-master-count (this defaults to 1) before bootstrapping the cluster.

tribe - The node will assume the 'tribe' node-type. Tribe nodes will wait until they have a relation to the master before
joining the cluster.

data - The node will assume the 'data' node-type. Data nodes will wait until they have a relation to the master before
joining the cluster.

ingest - The node will assume the 'ingest' node-type. Ingest nodes will wait until they have a relation to the master before
joining the cluster.

Juju Storage

This charm supports Juju storage (as of Juju 2.3).

To deploy this charm using Juju storage (most common for data nodes)

juju deploy elasticsearch --storage data=ebs,10G

Following deployment, we can see the attached volume, and that is being used for Elasticsearch data:

Basic (node-type='all')

Deploying this charm with the defaults will get you Elasticsearch installed from the elastic.co apt sources, and an all-in-one node-type, where
each unit is every node type.

For example:

juju deploy elasticsearch -n 3

The above command would deploy 3 elasticsearch nodes, of which all are master, data, ingest, and tribe.
This functionality mirrors that of the legacy Juju Elasticsearch charm, you can deploy and scale a cluster without worrying about node-types
because every node is all node-types.

Desparate Node Types

The extended functionality of this charm lends itself to the configuration of Elasticsearch clusters with non-uniform node-types.

Elasticsearch

(boolean)
this option will enable or disable the ufw. By default this is set to
'false' since the firewall is never enabled when a machine or container
is created with juju. Set to 'true' to enable firewall. Once enabled
rules will be added when another charm has a relation with elasticsearch.
This charm will be able to access elasticsearch on port 9200, while
all the other traffice to that port will be blocked. Enabling the firewall
will also allow port 22 from anywhere.

(string)
list of signing keys for install_sources package sources, per
charmhelpers standard format (a yaml list of strings encoded as
a string). the keys should be the full ascii armoured gpg public
keys. while gpg key ids are also supported and looked up on a
keyserver, operators should be aware that this mechanism is
insecure. null can be used if a standard package signing key is
used that will already be installed on the machine, and for ppa
sources where the package signing key is securely retrieved from
launchpad.

(string)
list of extra apt sources, per charm-helpers standard
format (a yaml list of strings encoded as a string). each source
may be either a line that can be added directly to
sources.list(5), or in the form ppa:<user>/<ppa-name> for adding
personal package archives, or a distribution component to enable.