Get the App
SLTechnology News&Howtos  ›  Servers  › 

Docker-compose deploy elasticsearc with one click

Shulou Source: shulou.com Published: 2022-06-02 04:18:01 10月02日 Update

Docker containers quickly and efficiently deploy applications, resource orchestration defines and runs multiple containers, declares each service through docker-compose.yml configuration files, and creates and starts as a whole.

ELK is a commonly used log management system, which is deployed with one click of Docker-compose, eliminating the tedious steps of installation and configuration.

L ELK architecture:

L Docker installation:

Https://docs.docker.com/install/linux/docker-ce/ubuntu/

Https://docs.docker.com/docker-for-windows/install/

L script download:

Https://github.com/rickding/HelloDocker/tree/master/elk

├── docker-compose.yml

├── pull.sh

├── up.sh

├── logs.sh

├── down.sh

L docker-compose.yml script to configure the ELK service:

Logstash and kibana need to connect to the elasticsearch instance, so the depends_on property is set.

Version:'3'

Services:

Elasticsearch:

Hostname: elasticsearch

Image: elasticsearch:latest

Restart: always

Ports:

-9200 purl 9200

-9300 purl 9300

Log:

Image: registry.cn-shanghai.aliyuncs.com/hellodock/logstash:latest

Restart: always

Ports:

-9600 purl 9600

-9601 Freund 9601

Depends_on:

-elasticsearch

Kibana:

Image: registry.cn-shanghai.aliyuncs.com/hellodock/kibana:latest

Restart: always

Ports:

-5601 Fraser 5601

Depends_on:

-elasticsearch

L pull.sh pull image

You can run docker pull elasticsearch:latest directly to pull the image and view it with docker images:

L up.sh startup container

The docker-compose up-d command is encapsulated in the script. After startup, run docker ps to view the container instance:

L logs.sh View Log

Custom commands highlight important information:

Docker-compose logs-ft | grep-- color-I-e error-e warn-e version-e exception

L down.sh stop service

Docker-compose down-- remove-orphans stops and deletes the container:

L View ELK service:

Elasticsearch:

Logstsh:

Kibana:

Using docker-compose to deploy ELK with one click is as simple as wayward.

Tags: Containers services scripts runs configurations one-click commands instances logs mirrors important wayward tedious information multiple namely attributes commonly used overall files Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Information Huawei MySQL MariaDB OPPO Reno