In this gist, we will quickly try to spin Elastic stacks with Docker containers. We are going to use docker-compose. You can learn more about Docker & Docker Compose, Which will help you to understand the flow.
Tested on the below configuration.
- docker:
Docker version 20.10.16, build aa7e414
- docker-compose:
Docker version 20.10.16, build aa7e414
This setup will include
- ✅ Elasticsearch
- ✅ Kibana
- ✅ Logstash
- ✅ APM Server
Clone repo:
git clone https://github.com/ashishtiwari1993/elastic-docker.git
cd elastic-docker
Make changes in .env
file.
docker-compose up -d
Just visit to localhost:5601
. You should see a kibana login page.
docker-compose down
docker-compose down -v
docker cp elastic-docker-es01-1:/usr/share/elasticsearch/config/certs/ca/ca.crt /tmp/
curl --cacert /tmp/ca.crt -u elastic:pass@123 https://localhost:9200
Place all *.conf
files in logstash_external_configs/pipeline/
. You can create folder and files in logstash_external_configs
which will get mounted on /usr/share/logstash/logstash_external_configs
in container.
Either you can add in docker-compose.yml
file or you can simply run command like below while container is up.
docker exec -it elastic-docker-logstash-1 bin/logstash-plugin install logstash-output-google_pubsub
You can simply comment other stacks which is not needed. For example if you want to just run Elasticsearch & Kibana, Just comment the APM or other stack specification.