This guide uses Docker to run Metricbeat as an example Beats shipper.
For Docker installation, see Docker.
Create a directory to store your configuration and compose files.
mkdir -p /opt/beats
cd /opt/beats
Define a container for Metricbeat.
services:
metricbeat:
image: docker.elastic.co/beats/metricbeat:8.11.0
user: root
volumes:
- ./metricbeat.yml:/usr/share/metricbeat/metricbeat.yml:ro
- /var/run/docker.sock:/var/run/docker.sock:ro
- /sys/fs/cgroup:/hostfs/sys/fs/cgroup:ro
- /proc:/hostfs/proc:ro
- /:/hostfs:ro
environment:
- ELASTICSEARCH_HOSTS=http://elasticsearch:9200
networks:
- monitoring
networks:
monitoring:
driver: bridge
Create metricbeat.yml with your Elasticsearch connection settings:
metricbeat.modules:
- module: system
metricsets:
- cpu
- memory
- network
- diskio
period: 10s
output.elasticsearch:
hosts: ["${ELASTICSEARCH_HOSTS}"]
Start the container in the background.
docker compose up -d
docker.elastic.co/beats/<beat-name>:<version>metricbeat with filebeat, heartbeat, auditbeat, etc.Any questions?
Feel free to contact us. Find all contact information on our contact page.