安装prometheus
docker run -d --restart=always --name prometheus -p 9090:9090 \
-v /opt/prometheus/conf/prometheus.yml:/etc/prometheus/prometheus.yml \
-v /opt/prometheus/data/:/prometheus \
-v /opt/prometheus/conf/rules:/usr/local/prometheus/rules \
prom/prometheus
或
docker run --name prometheus -d -p 9090:9090 --restart=always \
-v /opt/prometheus/conf/prometheus.yml:/etc/prometheus/prometheus.yml \
-v /opt/prometheus/data/:/prometheus \
-v /opt/prometheus/conf/rules:/usr/local/prometheus/rules \
prom/prometheus --config.file=/etc/prometheus/prometheus.yml --web.enable-lifecycle
安装 cadvisor
docker run -d --restart=always --name cadvisor -p 9080:8080 \
-v /:/rootfs:ro \
-v /var/run:/var/run:rw \
-v /sys:/sys:ro \
-v /var/lib/docker/:/var/lib/docker:ro \
-v /dev/disk/:/dev/disk:ro \
-v /etc/localtime:/etc/localtime:rw \
google/cadvisor
安装node-exporter
docker run -d --restart=always --name node-exporter -p 9100:9100 \
-v /proc:/host/proc:ro \
-v /sys:/host/sys:ro \
-v /:/rootfs:ro \
-v /etc/localtime:/etc/localtime:rw \
prom/node-exporter \
--path.procfs /host/proc \
--path.sysfs /host/sys \
--collector.filesystem.ignored-mount-points "^/(sys|proc|dev|host|etc)($|/)"
安装alertmanager
docker run -d -p 9093:9093 --restart always --name alertmanager \
-v /opt/prometheus/alertmanager/alertmanager.yml:/etc/alertmanager/alertmanager.yml \
-v /opt/prometheus/alertmanager:/alertmanager \
-v /opt/prometheus/alertmanager/template/email.tmpl:/usr/local/alertmanager/template/email.tmpl \
prom/alertmanager
安装grafana
docker run -d --restart=always -p 3000:3000 --name=grafana -v /opt/prometheus/grafana-storage:/var/lib/grafana grafana/grafana
正则(选中*.*.*.*:*)
/([^:]+):.*/