zoukankan      html  css  js  c++  java
  • 基于docker 搭建Prometheus+Grafana的过程详解

    1. 拉取依赖镜像

    docker pull prom/node-exporter
    docker pull prom/prometheus
    docker pull grafana/grafana
    

    2.分别启动各镜像

    1. 启动node-exporter

      docker run -d -p 9100:9100 
       --name node-exporter 
       --restart=always  
       -v /opt/dockerData/node-exporter/proc:/host/proc:ro 
       -v /opt/dockerData/node-exporter/sys:/host/sys:ro 
       -v /opt/dockerData/node-exporter:/rootfs:ro 
       prom/node-exporter
      
    2. 启动promethus

      docker run -d 
       --name prometheus 
       --restart=always 
       -u root 
       -p 9090:9090 
       -v /opt/dockerData/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml 
       -v /opt/dockerData/prometheus:/prometheus 
       -v /opt/dockerData/prometheus/conf:/etc/prometheus/conf 
       prom/prometheus
      

      prometheus.yml

      global:
        scrape_interval: 60s
        evaluation_interval: 60s
      
      scrape_configs:
        - job_name: prometheus
          static_configs:
            - targets:
                - 192.168.0.104:9090
      
        - job_name: node-exporter
          static_configs:
            - targets:
                - 192.168.0.104:9100
        - job_name: jenkins
          scheme: http
          metrics_path: prometheus
          bearer_token: bearer_token
          static_configs:
            - targets:
                - 192.168.57.242:8080
      
    3. 启动grafana

      docker run -d 
       -p 3000:3000 
       --restart=always 
       --name=grafana 
       -u root 
       -v /opt/dockerData/grafana:/var/lib/grafana 
       grafana/grafana
      

    3.登录grafana

    默认用户名和密码均为admin,登录成功后修改默认密码

  • 相关阅读:
    BZOJ 3144 [Hnoi2013]切糕
    一场比赛:20170707
    BZOJ 2815 [ZJOI2012]灾难
    BZOJ 1088 [SCOI2005]扫雷Mine
    BZOJ 1052 [HAOI2007]覆盖问题
    BZOJ 3505 [Cqoi2014]数三角形
    BZOJ 2957 楼房重建
    BZOJ 2654 tree
    丁酉年六月十一ACM模拟赛
    BZOJ 3438 小M的作物 & BZOJ 1877 [SDOI2009]晨跑
  • 原文地址:https://www.cnblogs.com/zepc007/p/14644690.html
Copyright © 2011-2022 走看看