一、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']

Rancher1.6 部署prometheus的更多相关文章

  1. kubernetes之监控Operator部署Prometheus(三)

    第一章和第二章中我们配置Prometheus的成本非常高,而且也非常麻烦.但是我们要考虑Prometheus.AlertManager 这些组件服务本身的高可用的话,成本就更高了,当然我们也完全可以用 ...

  2. k8s部署prometheus

    https://www.kancloud.cn/huyipow/prometheus/527092 https://songjiayang.gitbooks.io/prometheus/content ...

  3. 【集群监控】Docker上部署Prometheus+Alertmanager+Grafana实现集群监控

    Docker部署 下载 sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.re ...

  4. 基于k8s集群部署prometheus监控ingress nginx

    目录 基于k8s集群部署prometheus监控ingress nginx 1.背景和环境概述 2.修改prometheus配置 3.检查是否生效 4.配置grafana图形 基于k8s集群部署pro ...

  5. 基于k8s集群部署prometheus监控etcd

    目录 基于k8s集群部署prometheus监控etcd 1.背景和环境概述 2.修改prometheus配置 3.检查是否生效 4.配置grafana图形 基于k8s集群部署prometheus监控 ...

  6. k8s之自定义指标API部署prometheus

    1.自定义指标-prometheus node_exporter是agent;PromQL相当于sql语句来查询数据; k8s-prometheus-adapter:prometheus是不能直接解析 ...

  7. kubernetes1.11.1 部署prometheus

    部署前提:已经安装好了kubernetes的集群,版本是1.11.1,是用kubeadm部署的. 2台虚拟机:master:172.17.1.36      node1:172.17.1.40 pro ...

  8. k8b部署prometheus+grafana

    来源: https://juejin.im/post/5c36054251882525a50bbdf0 https://github.com/redhatxl/k8s-prometheus-grafa ...

  9. 在Kubernetes下部署Prometheus

    使用ConfigMaps管理应用配置 当使用Deployment管理和部署应用程序时,用户可以方便了对应用进行扩容或者缩容,从而产生多个Pod实例.为了 能够统一管理这些Pod的配置信息,在Kuber ...

随机推荐

  1. TCP/IP三次握手协议

    一.简介         三次握手协议指的是在发送数据的准备阶段,服务器端和客户端之间需要进行三次交互,OSI参考模型中的网络层,在TCP/IP协议中,TCP协议提供可靠的连接服务,采用三次握手建立一 ...

  2. C语言-耶稣门徒

    <span style="font-family: Arial, Helvetica, sans-serif;"> </span> <span sty ...

  3. pdf文件处理--QPDF

    1.分割pdf文件 从原文件中取出n-m页,保留原文件的目录格式: qpdf infile.pdf --pages . n-m -- outfile.pdf 从原文件中取出n-m页,不保留原文件的目录 ...

  4. Python 3中,import win32com.client 出错

    在 import win32com.client 时,出现了界面: Traceback (most recent call last): File "<pyshell#1>&qu ...

  5. C#数据结构与算法系列(二):稀疏数组(SparseArray)

    1.介绍 当一个数组中大部分元素为0,或者为同一个值的数组时,可以使用稀疏数组来保存该数组.    稀疏数组的处理方法是: 1.记录数组一共有几行几列,有多少个不同的值    2.把具有不同值的元素的 ...

  6. 有没有人想和我一起编写 Clear Writer 的?

    合作内容 程序编写 了解 JS.HTML.CSS 等基础前端技能,了解 Electron 开发. 翻译 熟练运用一门外语(中文英文除外),书面表达过关. 报酬 在 Github 上本项目里面的 REA ...

  7. tomcat的安装部署(windows10)

    一.Tomact下载 地址:https://tomcat.apache.org/

  8. matlab中imwrite函数详解(imwrite的输出格式)

    参考资料: https://www.mathworks.com/help/matlab/ref/imwrite.html?s_tid=srchtitle 你可能觉得imread函数很简单,但是还是有一 ...

  9. jmeter对数据库进行简单的压测

    1.点击测试计划,再点击“浏览”,把JDBC驱动添加进来: 注:JDBC驱动一般的位置在java的安装地址下,路径类似于:    \java\jre\lib\ext 文件为:mysql-connect ...

  10. 【大厂面试08期】谈一谈你对HashMap的理解?

    摘要 HashMap的原理也是大厂面试中经常会涉及的问题,同时也是工作中常用到的Java容器,本文主要通过对以下问题进行分析讲解,来帮助大家理解HashMap的原理. 1.HashMap添加一个键值对 ...