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 and ZFS together?
- How can I set up and use Elasticsearch on the Yandex Cloud platform?
- How do I configure elasticsearch to use an XMS memory allocator?
- How do I configure Elasticsearch shards?
- How can I configure an Elasticsearch Prometheus exporter?
- How do I set up an Elasticsearch Yum repository?
- How do I use an elasticsearch query builder?
- How can I integrate Elasticsearch into a Yii2 application?
- How can I use Yandex Mirror to access Elasticsearch data?
- How can I use an Elasticsearch tokenizer?
See more codes...