This demo shows how to create an ElasticSearch cluster with tree nodes using Docker Compose.
First, you need to install Docker and Docker Compose.
To create the cluster after cloning this repository, you need to start Docker Compose (detached mode):
docker-compose up -d
This command creates tree docker containers with an ElasticSearch instance inside each.
You can check the containers status using the command:
docker-compose ps
You can also check the cluster health by asking ElasticSearch first node: http://localhost:9201/_cluster/health
The head plugin is an ElasticSearch plugin supported by the community. It provides a simple and visual way to check the health of a cluster. You can find more explainations on its GitHub page
To install the plugin, you need to execute the following command:
docker-compose run --rm e1 /elasticsearch/bin/plugin -i mobz/elasticsearch-head
You can now check the cluster health at: http://localhost:9201/_plugin/head/
You can load data inside the cluster using the Bulk API and the sample dataset:
curl -XPOST 'localhost:9201/bank/account/_bulk?pretty' --data-binary @dataset/accounts.json
The sample dataset used has been found on ElasticSearch site
You can now stop and start some nodes to see how the cluster reacts:
docker-compose stop e2
docker-compose start e2