• 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']
  • 相关阅读:
    网站中使用了Excel组件问题 Microsoft.ACE.OLEDB.14.0' provider is not registered on the local machine
    键值对在架构设计里的应用
    轻轻松松 用U盘安装WIN7
    U盘装WIN7:微软官方工具《Windows 7 USB DVD Download Tool》U盘装wind7(更新官方整合SP1的WIN7 ISO)
    微软一站式示例代码库(中文版)20110924版本, 新添加ASP.NET, Windows Base, Silverlight, WinForm等20个Sample
    最薄笔记本苹果MacBook Air安装雪豹+Win7双系统的驱动解决方法
    使用受保护的配置加密配置信息
    自动加密web.config配置节批处理
    Asp.net MVC3学习
    周老师科研站
  • 原文地址:https://www.cnblogs.com/sky-k/p/13257392.html
Copyright © 2020-2023  润新知