Connecting Elasticsearch with ElasticHQ and Cerebro — Docker Based

Teten Nugraha
Backend Habit
Published in
3 min readJun 2, 2021

--

In this article I will show you how to connecting elasticsearch with elasticHQ and Cerebro.

Make sure that you installed docker on your local, in this article Im using these image:

  • lmenezes/cerebro:latest
  • elastichq/elasticsearch-hq:latest
  • elasticsearch:7.12.1

Running elasticsearch container using this command

docker run -d --name elasticsearch -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" elasticsearch:7.12.1

and then access localhost:9200 in your browser and make sure you get the response like this

and the important thing is get the ip address from the elasticsearch container with this command

docker inspect elasticsearch

and look into “NetworkSettings” part you’ll get the ip address

Run elasticHQ using this command

docker run -d --name elastichq -p 5000:5000 elastichq/elasticsearch-hq

elasticHQ running in port 5000 so you can access localhost:5000 on your browser. Default screen will be like this

and now, change the localhost:9200 using the ip address from elasticsearch container

and you will can access dashboard of elasticHQ

using that step also you can acces Cerebro, firstly run your cerebro image

docker run -d --name cerebro -p 9000:9000 lmenezes/cerebro

access localhost:9000 on your browser and connect with elasticsearch using ip address 172.17.0.2:9200

If it was interesting or helpful to you, please do press the 👏 clap button and help others find this story too or if you wanna talk internally with me , reach me in https://linktr.ee/teten_nugraha.

--

--

Teten Nugraha
Backend Habit

Software Engineer, 8 years of experience. Expertise with Microservices, Spring Boot, CICD, Docker https://www.linkedin.com/in/teten-nugraha