Skip to content

1. docker-compose方式

https://www.cnblogs.com/goldsunshine/p/17954957#部署prometheusalert

vi docker-compose.yml

yaml

2. docker方式

  • 创建目录
mkdir -p /data/prometheus
mkdir -p /data/prometheus
  • 拉取官方镜像
docker pull prom/prometheus

docker pull grafana/grafana

docker pull prom/node-exporter

docker pull oliver006/redis_exporter
docker pull prom/prometheus

docker pull grafana/grafana

docker pull prom/node-exporter

docker pull oliver006/redis_exporter
bash
docker run -d -p 9090:9090 \ 
--net=host \
-v /data/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml \ 
-v /data/prometheus: \ 
prom/prometheus \ 
--config.file="/etc/prometheus/prometheus.yml" \ 
--storage.tsdb.path="/data/prometheus"
docker run -d -p 9090:9090 \ 
--net=host \
-v /data/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml \ 
-v /data/prometheus: \ 
prom/prometheus \ 
--config.file="/etc/prometheus/prometheus.yml" \ 
--storage.tsdb.path="/data/prometheus"