# 拉取镜像
docker pull prom/prometheus
# 创建并编辑文件
mkdir /usr/local/prometheus
cd /usr/local/prometheus
vi prometheus.yml
global:
scrape_interval: 15s
evaluation_interval: 15s
alerting:
alertmanagers:
- static_configs:
- targets:
rule_files:
scrape_configs:
- job_name: 'prometheus'
static_configs:
- targets: ['192.168.5.11:9090']
# 启动镜像
docker run -d --name prometheus -p 9090:9090 -v/usr/local/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml prom/prometheus
# 测试访问
http://192.168.5.11:9090/
# 拉取镜像
docker pull grafana/grafana
mkdir /usr/local/grafana
chmod 777 /usr/local/grafana
# 启动镜像
docker run -d --name grafana -p 3000:3000 -v /usr/local/grafana:/var/lib/grafana grafana/grafana
#测试地址
http://192.168.5.11:3000/
admin/admin
Docker部署系列:搭建Prometheus+Grafana监控
于 2022-12-18 13:10:29 首次发布