(实战)docker-compose部署分布式日志方案EFK(Elasticsearch+Fluentd+Kibana)
version: '3'
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:7.10.0
environment:
- discovery.type=single-node
volumes:
- esdata1:/usr/share/elasticsearch/data
ports:
- "9200:9200"
networks:
- efk-net
fluentd:
image: fluent/fluentd:latest
volumes:
- ./fluentd/conf:/fluentd/etc
links:
- elasticsearch
depends_on:
- elasticsearch
networks:
- efk-net
kibana:
image: docker.elastic.co/kibana/kibana:7.10.0
environment:
- ELASTICSEARCH_URL=http://elasticsearch:9200
ports:
- "5601:5601"
depends_on:
- elasticsearch
networks:
- efk-net
volumes:
esdata1:
driver: local
networks:
efk-net:
driver: bridge
这个docker-compose.yml文件定义了Elasticsearch、Fluentd和Kibana的基本服务配置,以便于部署一个基本的EFK日志分析系统。其中,Elasticsearch作为数据存储,Fluentd作为日志收集器,Kibana提供日志分析的Web界面。这个配置假设你的机器上有Docker和Docker Compose安装好。
评论已关闭