docker 安装prometheus命令

1、docker pull prom/prometheus

2、在本地创建一个prometheus.yml文件: touch prometheus.yml

prometheus.yml配置内容:

global:
  scrape_interval:     15s
  evaluation_interval: 15s
 
rule_files:
  - rules/*.rules
 
 
scrape_configs:
  - job_name: 'prometheus'
    scrape_interval: 5s
    static_configs:
    - targets: ['localhost:9090']
 
  - job_name: 'node_exporter'
    scrape_interval: 10s
    static_configs:
      - targets: ['ip:9100']
 
  - job_name: 'mysql'
    scrape_interval: 10s
    static_configs:
      - targets: ['ip:9104']

3、docker运行prometheus容器

 

posted @ 2022-10-03 21:49  heipidaren  阅读(46)  评论(0)    收藏  举报