Sign inSign up

mikelorant/elasticsearch

By mikelorant

•Updated over 7 years ago

Elasticsearch is a powerful open source search and analytics engine that makes data easy to explore.

Image
0

5.9K

mikelorant/elasticsearch repository overview

⁠Elasticsearch

An opinionated Docker implementation for Elasticsearch focused on providing a reliable yet flexible solution based on the upstream official image.

⁠Features

There are a number of features that differentiate this implementation from the official or other solutions.

  • Configuration determined at runtime by a powerful templating engine.
  • AWS availability zone awareness auto detection.
  • Extra configuration snippets easy to add.
  • Heap sized based on container memory and percentages.
  • Enables AWS S3 plugin for snapshots.
  • Enables Prometheus plugin for metrics.

⁠Getting Started

This implementation is designed to be used with a Helm chart. However, there is a docker compose file included for testing this implementation locally. Bringing up a test cluster and discovering the client endpoint is easily done with just 2 commands.

docker-compose up

It will likely take a few minutes for the containers to start and you can verify when it is available using curl.

curl $(docker-compose port client 9200)
⁠Prerequisites

The only requirements for bringing up this implementation locally is Docker.

Docker 17.12.0+

However, be aware that Elasticsearch has significant memory requirements especially since it is Java based and it is necessary to allocate the heap on start to prevent memory fragmentation. With 4 Elasticsearch containers (Discovery, Master, Data and Client), Kibana and Cerebro at least 4388Mi of RAM is required in heap allocation, preferably 6Gi if there is capacity.

⁠Installing

It is expected that the Helm chart will be used to install this container. For local development, there are a number of ways to interact with Elasticsearch.

The client endpoint is the main way applications interact with Elasticsearch.

docker-compose port client 9200

Management of Elasticsearch is available using Kibana.

docker-compose port kibana 5601

An alternative management interface is available using Cerebro.

docker-compose port cerebro 9000
⁠Environmental Variables
VariableDefaultComment
ES_CLUSTER_NAMEexample
ES_NETWORK_HOST0.0.0.0
ES_NODE_NAMEnode
ES_NODE_MASTERfalse
ES_NODE_DATAfalse
ES_XPACK_SECURITY_ENABLEDfalse
ES_XPACK_MONITORING_ENABLEDtrue
ES_XPACK_MONITORING_COLLECTION_ENABLEDtrue
ES_EMAIL_AWS_SES_ENABLEDfalse
ES_EMAIL_AWS_SES_HOSTemail-smtp.us-east-1.amazonaws.com
ES_EMAIL_AWS_SES_USERUnset
ES_EMAIL_AWS_SES_PASSWORDUnset
ES_HTTP_CORS_ENABLEDfalse
ES_HTTP_CORS_ALLOW_ORIGIN*
ES_GATEWAY_RECOVER_AFTER_DATA_NODES1
ES_GATEWAY_EXPECTED_DATA_NODES1
ES_GATEWAY_RECOVER_AFTER_TIME1m
ES_DISCOVERY_ZEN_MINIMUM_MASTER_NODES1
ES_DISCOVERY_ZEN_PING_UNICAST_HOSTSlocalhost
ES_DISCOVERY_TYPEUnset
⁠Extra Settings

The existence of /usr/share/elasticsearch/config/elasticsearch_custom.yml will automatically be appended to the elasticsearch.yml settings at runtime.

⁠Memory Allocation

Running a JVM in a container requires an understand of the relationship of the cgroups memory limit and the heap size. There is an overhead required in running a JVM as well which is approximate 348Mi.

A simple formula to use to determine the RAM percentage is as follows:

(Memory Limit - 384Mi / Memory Limit) * 100

⁠Deployment

For use on live systems, see the documentation for the Helm chart.

⁠Components

⁠Contributing

Please read CONTRIBUTING.md⁠ for details on our code of conduct, and the process for submitting pull requests to us.

⁠Versioning

We use SemVer⁠ for versioning. For the versions available, see the tags on this repository⁠.

⁠Authors

  • Michael Lorant - Initial work - Nine⁠

See also the list of contributors⁠ who participated in this project.

⁠License

This project is licensed under the MIT License - see the LICENSE.md⁠ file for details

⁠Acknowledgments

  • Elastic
  • Nine

Tag summary

Content type

Image

Digest

Size

409.3 MB

Last updated

over 7 years ago

docker pull mikelorant/elasticsearch