- Briefly installing Elasticsearch and Kibana with Docker compose.
- You can work with Elasticsearch and Kibana running in docker environment by following the steps below. ```
//Windows powershell
mkdir Elasticsearch8.7.1
cd Elasticsearch8.7.1
New-Item -Path "docker-compose.yml"
code .
**NOTE: Before running docker-compose, make sure Docker is installed and running on your computer :)
**
// docker-compose.yml
version: '3'
services:
elasticsearch:
container_name: elasticsearch
image: docker.elastic.co/elasticsearch/elasticsearch:8.7.1
# 8.x
environment: ['CLI_JAVA_OPTS=-Xms2g -Xmx2g','bootstrap.memory_lock=true','discovery.type=single-node','xpack.security.enabled=false', 'xpack.security.enrollment.enabled=false']
ports:
- 9200:9200
networks:
- elastic
ulimits:
memlock:
soft: -1
hard: -1
nofile:
soft: 65536
hard: 65536
deploy:
resources:
limits:
cpus: '2.0'
reservations:
cpus: '1.0'
kibana:
image: docker.elastic.co/kibana/kibana:8.7.1
container_name: kibana
environment:
XPACK_ENCRYPTEDSAVEDOBJECTS_ENCRYPTIONKEY: d1a66dfd-c4d3-4a0a-8290-2abcb83ab3aa
ports:
- 5601:5601
networks:
- elastic
deploy:
resources:
limits:
cpus: '2.0'
reservations:
cpus: '1.0'
networks:
elastic:
In the directory where docker-compose is located
docker-compose up
You can see the containers working from Docker Desktop application. Click on the links Elasticsearch and kibana to see that both are ready to use.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/30d57qx41lbra87y62g0.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/eflz1jzp9woku39ah84z.png)
Top comments (5)
Good starting point. Thanks.
Two questions:
1) Is the data persistent with this setup?
2) Is the Kibana instance ready to access the Elasticsearch data or there is the need to do additional configuration?
Having troubles myself getting this working. In the docker compose provided above there's this key that seems not safe to reuse over and over.
'XPACK_ENCRYPTEDSAVEDOBJECTS_ENCRYPTIONKEY: d1a66dfd-c4d3-4a0a-8290-2abcb83ab3aa'
To answer your questions though,
1> No, there are no bind mounts for :/usr/share/elasticsearch/data or
/usr/share/kibana/config (i'm not sure if needed for kibana really, but I know for data elasticsearch, bind mount is needed to stay persistent and not delete later.)
2> I'm not sure how but kibana can access elasticsearch by generated key. Not really sure how it get's the key. but it seems to get it in my instance and says (redacted) where it should be in logs.
With all that said, I'm still having issues with kibana being able to access integrations to install.
1 ) Data is permanent.
2 ) No additional configuration is required, they are directly connected to each other.
but after
http://localhost:5601/
return errorKibana server is not ready yet.
It should work without errors