elasticsearchHow can I use Docker Compose to set up Elasticsearch and Kibana?
Docker Compose can be used to quickly set up Elasticsearch and Kibana.
To get started, create a docker-compose.yml
file and add the following configuration:
version: '2'
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:7.8.0
ports:
- 9200:9200
environment:
- node.name=elasticsearch
- discovery.type=single-node
kibana:
image: docker.elastic.co/kibana/kibana:7.8.0
ports:
- 5601:5601
environment:
- ELASTICSEARCH_URL=http://elasticsearch:9200
version
: Specifies the version of the Docker Compose file format.services
: Defines the services to be run by Docker Compose.elasticsearch
: Defines the configuration for the Elasticsearch service.image
: Specifies the Docker image to be used for the Elasticsearch service.ports
: Specifies the port mapping for the Elasticsearch service.environment
: Specifies environment variables for the Elasticsearch service.kibana
: Defines the configuration for the Kibana service.image
: Specifies the Docker image to be used for the Kibana service.ports
: Specifies the port mapping for the Kibana service.environment
: Specifies environment variables for the Kibana service.
Once the configuration is in place, run the following command to start the services:
docker-compose up -d
The output should look like this:
Creating network "docker_default" with the default driver
Creating docker_elasticsearch_1 ... done
Creating docker_kibana_1 ... done
The two services should now be up and running. You can verify this by running docker-compose ps
:
Name Command State Ports
----------------------------------------------------------------
docker_elasticsearch_1 /usr/local/bin/docker-entr ... Up 0.0.0.0:9200->9200/tcp, 9300/tcp
docker_kibana_1 /usr/local/bin/dumb-init - ... Up 0.0.0.0:5601->5601/tcp
You can now access the Elasticsearch and Kibana services on the specified ports.
Helpful links
More of Elasticsearch
- How can I use elasticsearch zone awareness to improve my software development?
- How do I use Elasticsearch with ZGC?
- How can I use Elasticsearch and ZFS together?
- How can I use Elasticsearch and Zookeeper together to manage distributed applications?
- How can I implement pagination with Elasticsearch?
- How can I use Elasticsearch and Zabbix together for software development?
- How can I use Elasticsearch to diagnose "yellow" issues?
- How do I set up an Elasticsearch Yum repository?
- How can I use YouTube to learn about Elasticsearch?
- How can I set up and use Elasticsearch on the Yandex Cloud platform?
See more codes...