Elasticsearch + Kibana using Docker Compose
Posted by Aly Sivji in Quick Hits
Earlier this week, I went through the fantastic PyCon 2018 tutorial, Building a Search Engine with Python + Elasticsearch. This required me to have a local installation of Elasticsearch and Kibana.
Local installation? Time to spin up Docker, more specifically, Docker Compose.
Docker-Compose is a tool that allows us to define and run multi-container Docker applications. Over the past year, I've used Docker-Compose everytime I need to add another process to my development workflow.
- Python project? Create a new virtual environment.
- Python + anything else? Docker-Compose is my workhorse.
In this Quick Hit, I will describe how to create a containerized installation Elasticsearch + Kibana.
[Note: I gave a detailed introduction to the Docker ecosystem at a Chicago Python meetup back in October 2017].
Instructions
- Populate
docker-compose.yml
with the following configuration:
# ./docker-compose.yml
version: '3'
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:6.3.2
environment:
- cluster.name=docker-cluster
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
ulimits:
memlock:
soft: -1
hard: -1
ports:
- "9200:9200"
kibana:
image: docker.elastic.co/kibana/kibana:6.3.2
ports:
- "5601:5601"
- Execute
docker-compose up -d
in the terminal- Elasticsearch is available at http://localhost:8100/
- Kibana UI is up at http://localhost:5601/
Comments