Setup Elasticsearch Cluster 8.x with Docker Compose

Published on 2024-09-26

« Back to all documents Contact Us
Setup Elasticsearch Cluster 8.x with Docker Compose

Introduction

Code on Github: Elasticsearch Cluster + Docker Compose

We will setup Elasticsearch Cluster with 3 nodes with Docker Compose.

This video assumes you already know how to setup Elasticesearch Cluster and Kibana without using a Containerized system. If not then you can go here.

Requirements

Step 1 - Get the Code

Initialize a new git repository.

git init; git remote add origin https://github.com/evermight/elastic-cluster-docker-compose; git fetch -a; git checkout master

You will likely need to set the vm.max_map_count to avoid memory issues. Use this command:

sudo sysctl -w vm.max_map_count=262144

Build with the below docker compose command.

docker-compose up --build -d

Get the IP address of your server for it will be used as the url to the docker containers.

hostname -i

Visit Kibana page with http://<YOUR IP ADDRESS>:5601. Then login with the elastic username and password present at the .env file

username: elastic password: changeme

If you need any assistance, email us through our Contact Form.