Running a 3 Node Elasticsearch Cluster With Docker Compose on Your Laptop for Testing
Having a Elasticsearch cluster on your laptop with Docker for testing is great. And in this post I will show you how quick and easy it is, to have a 3 node elasticsearch cluster running on docker for testing.
We need to set the vm.max_map_count kernel parameter:
$ sudo sysctl -w vm.max_map_count=262144
To set this permanently, add it to /etc/sysctl.conf and reload with sudo sysctl -p
$ curl http://127.0.0.1:9200/_cat/indices?v
health status index uuid pri rep docs.count docs.deleted store.size pri.store.size
green open test w4p2Q3fTR4uMSYBfpNVPqw 5210 3.3kb 1.1kb
green open .monitoring-es-6-2018.04.29 W69lql-rSbORVfHZrj4vug 11160138 4mb 2mb
Kibana is also included in the stack and is accessible via http://localhost:5601/ and you it should look more or less like:
Elasticsearch Head UI
I always prefer working directly with the RESTFul API, but if you would like to use a UI to interact with Elasticsearch, you can access it via http://localhost:9100/ and should look like this:
Deleting the Cluster:
As its running in the foreground, you can just hit ctrl + c and as we persisted data in our compose, when you spin up the cluster again, the data will still be there.