# 拉取镜像
docker pull prom/prometheus:v2.22.0

# 创建配置文件
mkdir -p /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
# 运行容器
docker run -d --name prometheus -p 9090:9090 -v /opt/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml prom/prometheus:v2.22.0

浏览器访问:http://宿主机ip:9090

相关文章:

  • 2022-12-23
  • 2021-11-02
  • 2021-07-23
  • 2022-03-07
  • 2022-12-23
  • 2022-01-30
  • 2023-02-04
  • 2022-03-06
猜你喜欢
  • 2021-11-13
  • 2021-06-30
  • 2022-12-23
  • 2022-01-25
  • 2022-12-23
  • 2021-11-10
  • 2022-12-23
相关资源
相似解决方案