![cover](https://img-blog.csdnimg.cn/img_convert/3869a1bf1a42471495519d5a7fc6c252.png)
基于Docker搭建promethues
基于Docker搭建promethues
·
下载镜像包:
docker pull prom/node-exporter
docker pull prom/prometheus
docker pull grafana/grafana
启动node-exporter:
docker run -d -p 9100:9100 \
-v "/proc:/host/proc:ro" \
-v "/sys:/host/sys:ro" \
-v "/:/rootfs:ro" \
prom/node-exporter
访问URL:
启动prometheus:
新建目录 prometheus,编辑配置文件prometheus.yml
mkdir /opt/prometheus
cd /opt/prometheus/
vim prometheus.yml
内容如下:
global:
scrape_interval: 60s
evaluation_interval: 60s
scrape_configs:
- job_name: prometheus
static_configs:
- targets: ['localhost:9090']
labels:
instance: prometheus
- job_name: linux
static_configs:
- targets: ['127.0.0.1:9100']
labels:
instance: localhost
启动prometheus:
docker run -d \
-p 9090:9090 \
-v /opt/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml \
prom/prometheus
访问url :
127.0.0.1:9090/graph
更多推荐
所有评论(0)