安装环境要求
- centos7.6
- docker,docker-compose
编写docker-compose.yml及.env
docker network create elk --driver bridge
EKL_TAG=7.6.2
# docker-compose.yml
# .env <- EKL_TAG=7.6.2
# docker-compose --compatibility up -d
version: "3.1"
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:${EKL_TAG}
ports:
- "9200:9200"
- "9300:9300"
environment:
discovery.type: single-node
deploy:
resources:
limits:
memory: 512M
kibana:
image: docker.elastic.co/kibana/kibana:${EKL_TAG}
depends_on:
- elasticsearch
ports:
- "5601:5601"
deploy:
resources:
limits:
memory: 512M
logstash:
image: docker.elastic.co/logstash/logstash:${EKL_TAG}
depends_on:
- elasticsearch
ports:
- "9600:9600"
deploy:
resources:
limits:
memory: 512M
stdin_open: true
tty: true
entrypoint: logstash -e 'input { stdin{} } output { elasticsearch { hosts => ["elasticsearch:9200"] } }'
networks:
default:
external:
name: elk #使用外部网络,要提前创建 docker network create elk --driver bridge
启动
docker-compose --compatibility up -d
网友评论