yaml文件内容及权限:
global:
scrape_interval: 15s # 定义抓取指标的时间间隔
evaluation_interval: 15s # 定义评估规则的时间间隔
scrape_configs:
- job_name: 'prometheus' # 设置监控任务的名称
static_configs: # 定义静态目标配置
- targets: ['localhost:9090'] # 目标的地址和端口
chmod 755 /root/promdata/prometheus.yml
安装prometheus镜像:
docker pull prom/prometheus
启动镜像:
docker run -p 9090:9090 -v /root/promdata/prometheus.yml:/etc/prometheus/prometheus.yml prom/prometheus(成功)
docker run -d --name prometheus -p 9090:9090 -v /root/promdata:/etc/prometheus prom/prometheus(没成功)
标签:07,9090,prometheus,promdata,prom,docker,yml,搭建 From: https://www.cnblogs.com/csfsz/p/17998225