zoukankan      html  css  js  c++  java
  • Rancher1.6 部署prometheus

    一、rancher基础配置

    镜像:prom/prometheus:latest

    映射端口:9090:9090

    服务连接:

    blackbox-exporter

    cadvisor

    node-exporter

    挂载卷:

    /home/work/prometheus:/etc/prometheus/

    调度:

    monitor=true

    二、配置文件挂载

    需要修改监听机器IP:

    prometheus.yml
    global:
      scrape_interval:     15s
      evaluation_interval: 15s
      external_labels:
          monitor: 'exporter-metrics'
     
    alerting:
      alertmanagers:
        - static_configs:
          - targets: ["alertmanager:9093"]
     
    # Settings related to the remote write feature.
    remote_write:
     
    remote_read:
     
    scrape_configs:
     
    - job_name: 'HostsMetrics'
      dns_sd_configs:
      - names:
        - node-exporter
        refresh_interval: 15s
        type: A
        port: 9100
     
     
    - job_name: 'RancherServerMetrics'
      dns_sd_configs:
      - names:
        - cadvisor
        refresh_interval: 15s
        type: A
        port: 8080
     
    - job_name: 'RancherApi'
      dns_sd_configs:
      - names:
        - 'prometheus-rancher-exporter'
        refresh_interval: 15s
        type: A
        port: 9173
     
    - job_name: 'Prometheus'
      static_configs:
        - targets:
          - '127.0.0.1:9090'
     
    - job_name: 'ng_02blackbox'
      metrics_path: /probe
      params:
        module: [http_2xx]  # Look for a HTTP 200 response.
      static_configs:
        - targets:
          - http://www.baidu.co    # Target to probe with http.
          - https://www.baidu.co   # Target to probe with https.
      relabel_configs:
        - source_labels: [__address__]
          target_label: __param_target
        - source_labels: [__param_target]
          target_label: instance
        - target_label: __address__
          replacement: 10.116.1.157:9115  # The blackbox exporter's real hostname:port.
     
    - job_name: 'ng_01blackbox'
      metrics_path: /probe
      params:
        module: [http_2xx]  # Look for a HTTP 200 response.
      static_configs:
        - targets:
          - http://www.baidu.co    # Target to probe with http.
          - https://www.baidu.co   # Target to probe with https.
     
      relabel_configs:
        - source_labels: [__address__]
          target_label: __param_target
        - source_labels: [__param_target]
          target_label: instance
        - target_label: __address__
          replacement: 10.116.1.155:9115  # The blackbox exporter's real hostname:port.
     
    - job_name: 'uc-upstream'
      metrics_path: /probe
      params:
        module: [http_2xx]  # Look for a HTTP 200 response.
      static_configs:
        - targets:
          - http://10.116.1.157:2500/uc/_monitor
          - http://10.116.1.155:2500/uc/_monitor
      relabel_configs:
        - source_labels: [__address__]
          target_label: __param_target
        - source_labels: [__param_target]
          target_label: instance
        - target_label: __address__
          replacement: 10.116.1.155:9115  # The blackbox exporter's real hostname:port.
     
     
    - job_name: 'ng_02port_status'
      metrics_path: /probe
      params:
        module: [tcp_connect]
      static_configs:
        - targets: ['127.0.0.1:443','127.0.0.1:80','10.116.1.155:2500','10.116.1.157:2500','10.116.1.155:3100','10.116.1.157:3100','10.116.1.157:4080','10.116.1.155:4090','10.116.1.155:4410','10.116.1.155:1101','10.116.1.157:1101']
          labels:
            instance: 'port_status'
            group: 'tcp'
      relabel_configs:
        - source_labels: [__address__]
          target_label: __param_target
        - target_label: __address__
          replacement: 10.116.1.157:9115
     
     
    - job_name: 'ng_01port_status'
      metrics_path: /probe
      params:
        module: [tcp_connect]
      static_configs:
        - targets: ['127.0.0.1:443','127.0.0.1:80','10.116.1.155:2500','10.116.1.157:2500','10.116.1.155:3100','10.116.1.157:3100','10.116.1.157:4080','10.116.1.155:4090','10.116.1.155:4410','10.116.1.155:1101','10.116.1.157:1101']
          labels:
            instance: 'port_status'
            group: 'tcp'
      relabel_configs:
        - source_labels: [__address__]
          target_label: __param_target
        - target_label: __address__
          replacement: 10.116.1.155:9115
     
    - job_name: 'kafka_exporter'
      static_configs:
      - targets: ['10.116.1.156:9308']
     
    - job_name: 'jmx_exporter'
      static_configs:
      - targets: ['10.116.1.156:9309']
  • 相关阅读:
    常用MIME类型(Flv,Mp4的mime类型设置)
    iOS完全自学手册——[一]Ready?No!
    iOS开发总结--三方平台开发之微信支付
    iOS开发总结--三方平台开发之分享
    SVN图形客户端上传静态库.a文件失败
    iOS开发--应用国际化,应用内切换语言
    iOS开发总结——项目目录结构
    iOS开发总结——协议代理的认识
    iOS 学习笔记
    iOS mark list
  • 原文地址:https://www.cnblogs.com/sky-k/p/13257392.html
Copyright © 2011-2022 走看看