prometheus-pushgateway安装
背景
当prometheus的server与target不在同一网段网络不通,无法直接拉取target数据,需要使用pushgateway作为数据中转点。
弊端
将多个节点数据汇总到 pushgateway, 如果 pushgateway 挂了,受影响比多个 target 大。
Prometheus 拉取状态 up 只针对 pushgateway, 无法做到对每个节点有效。
Pushgateway 可以持久化推送给它的所有监控数据。即使你的监控已经下线,prometheus 还会拉取到旧的监控数据,需要手动清理 pushgateway 不要的数据。
实验环境
以下pushgateway分别prometheus exporter互通,其他都不通
prometheus 10.2.1.11
pushgateway 10.3.1.11
exporter 10.2.1.11
部署
pushgateway
下载安装包 pushgateway-0.8.0.linux-amd64.tar.gz (https://prometheus.io/download/#pushgateway/ )
tar -xvf pushgateway-0.8.0.linux-amd64.tar.gz -C /usr/local
mv /usr/local/pushgateway-0.8.0.linux-amd64 /usr/local/pushgateway
启动服务
cd /usr/local/pushgateway/
./pushgateway &
prometheus
新增job pushgateway
vim /usr/local/prometheus/prometheus.yml
- job_name: 'pushgateway'
scrape_interval: 30s
honor_labels: true #加上此配置exporter节点上传数据中的一些标签将不会被pushgateway节点的相同标签覆盖
static_configs:
- targets: ['10.3.1.11:9091']
labels:
instance: pushgateway
查看target状态:

exporter
安装好node_exporter,此处不多介绍
传送监控数据到pushgateway节点
对于传过去的监控项会添加此处定义的标签 job=test instance=10.2.1.11 hostname=ip-10-2-1-11
curl 127.0.0.1:9100/metrics|curl --data-binary @- http://10.3.1.11:9091/metrics/job/test/instance/10.2.1.11/hostname/ip-10-2-1-11
此处也可以传送自定义的监控项值,以及自定义监控脚本抓取的值
echo "logic_cpu 5" |curl --data-binary @- http://10.3.1.11:9091/metrics/job/test/instance/10.2.1.11/hostname/ip-10-2-1-11
删除某个实例的数据:
curl -X DELETE http://10.3.1.11:9091/metrics/job/test/instance/10.2.1.11/hostname/ip-10-2-1-11
prometheus-pushgateway安装的更多相关文章
- prometheus学习系列十一: Prometheus pushgateway的使用
由于网络问题或者安全问题,可能我们的数据无法直接暴露出一个entrypoint 给prometheus采集. 这个时候可能就需要一个pushgateway来作为中间者完成中转工作. promethe ...
- Prometheus+Grafana安装搭建
介绍 Prometheus是由SoundCloud开发的开源监控报警系统和时序列数据库(TSDB).Prometheus使用Go语言开发,是Google BorgMon监控系统的开源版本. 2016年 ...
- Prometheus(一):Prometheus+Grafana 安装配置
一.基础环境 系统 IP 监控主机 CentOS 7 192.168.56.200 被监控主机 CentOS 7 192.168.56.201 二.Prometheus服务端安装 以下操作皆在监控主机 ...
- 监控神器-普罗米修斯Prometheus的安装
搬砖党的福音:普罗米修斯-监控神器 功能: 在业务层用作埋点系统 Prometheus支持多种语言(Go,java,python,ruby官方提供客户端,其他语言有第三方开源客户端).我们可以通过客户 ...
- prometheus虚拟化安装脚本
在线安装下载链接:https://files.cnblogs.com/files/blogs/705493/online_prometheus.sh 离线安装下载链接:https://files.cn ...
- prometheus + grafana安装部署(centos6.8)
官方网址:https://prometheus.io/ GitHub网址:https://github.com/prometheus/prometheus 软件下载地址:https://prometh ...
- 微服务监控神器Prometheus的安装部署
本文涉及:如何在k8s下搭建Prometheus+grafana的监控环境 基本概念 Prometheus提供了容器和云原生领域数据搜集.存储.处理.可视化和告警一套完整的解决方案,最初时是由Soun ...
- prometheus部署安装
1. 下载&部署 # 下载 [root@prometheus src]# cd /usr/local/src/ [root@prometheus src]# wget https://gith ...
- Prometheus完整安装
官方组件: prometheus node_exporter blackbox_exporter alertmanager VictoriaMetrics 第三方开源软件: ConsulManager ...
- Prometheus 和 Grafana 安装部署
Prometheus 是一套开源的系统监控报警框架.Prometheus 作为生态圈 Cloud Native Computing Foundation(简称:CNCF)中的重要一员,其活跃度仅次于 ...
随机推荐
- Maven - 配置setting.xml
1.配置本地库路径 <localRepository>C:/fyliu/mvn/repo</localRepository> 2.配置中央仓库 <mirror> & ...
- Android快捷键大全
参考来源:https://mp.weixin.qq.com/s/T809p17Wt8XHkbLwcQf9ow 1,Ctrl + J 快捷代码列表 2,Ctrl+Alt+O 这个快捷键可以自动导包或删 ...
- shell基础#1
shell:能直接调用命令(python)1.bash的基本特性 ctrl+L 清屏2.IO重定向与管道符 都由shell提供 命令是一个可执行的二进制程序3.编程基础 编程原理 程序:执行某个功能的 ...
- PythonDay15
第十五章装饰器_递归 今日内容 带参数装饰器 多个装饰器修饰一个函数 递归 带参数的装饰器 # 判断argv,当登录不同的网页,会有不同的装饰效果def auth(argv): def warpp ...
- AtCoder Beginner Contest 072
这应该是我第二次打AtCoder, 题目其实并不难,就是自己经验不足想复杂了,再加上自己很笨,愣是做了97分钟才全做出来(最后三分钟,有点小激动..),看着前面大牛半个小时都搞完了,真心膜拜一下,代码 ...
- Tarjan算法求有向图强连通分量并缩点
// Tarjan算法求有向图强连通分量并缩点 #include<iostream> #include<cstdio> #include<cstring> #inc ...
- JAVA重写不需要@override
一,如下代码, package com.boot.enable.bootenable; import org.springframework.scheduling.annotation.Async; ...
- RateLimit--使用guava来做接口限流
转:https://blog.csdn.net/jiesa/article/details/50412027 一.问题描述 某天A君突然发现自己的接口请求量突然涨到之前的10倍,没多久该接口几乎不 ...
- MySQL数据库入门备份数据库
MySQL数据库入门——备份数据库 一提到数据,大家神经都会很紧张,数据的类型有很多种,但是总归一点,数据很重要,非常重要,因此,日常的数据备份工作就成了运维工作的重点中的重点的重点....... ...
- UnknownPropertyException(Yii2)
在class里面的rule有属性,但是没声明