docker一键部署EFK系统(elasticsearch filebeat kibana metricbeat es-head)
以下是一个简化版的Docker Compose文件示例,用于一键部署包含Elasticsearch、Filebeat、Kibana、Metricbeat和Elasticsearch-head的EFK系统。
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"
- "9300:9300"
kibana:
image: docker.elastic.co/kibana/kibana:7.10.0
environment:
- ELASTICSEARCH_URL=http://elasticsearch:9200
ports:
- "5601:5601"
depends_on:
- elasticsearch
filebeat:
image: docker.elastic.co/beats/filebeat:7.10.0
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /proc/:/host/proc/:ro
- /sys/fs/cgroup/:/host/sys/fs/cgroup:ro
environment:
- ELASTICSEARCH_HOST=elasticsearch
depends_on:
- elasticsearch
metricbeat:
image: docker.elastic.co/beats/metricbeat:7.10.0
volumes:
- /proc/:/host/proc/:ro
- /sys/fs/cgroup/:/host/sys/fs/cgroup:ro
environment:
- ELASTICSEARCH_HOST=elasticsearch
depends_on:
- elasticsearch
es-head:
image: docker.io/mobz/elasticsearch-head:5
ports:
- "9100:9100"
environment:
- NODE_ENV=development
depends_on:
- elasticsearch
volumes:
esdata1:
driver: local
将以上内容保存为docker-compose.yml
文件,然后在终端中运行以下命令来启动EFK系统:
docker-compose up -d
请确保您的机器有足够的资源来运行Elasticsearch、Kibana以及相关的Beats组件。
评论已关闭