参考:https://blog.51cto.com/lee90/2062252

官网对于联邦的介绍:https://prometheus.io/docs/prometheus/latest/federation/

prometheus2.0 在参数上有原先的1.X有较大的变化,很多参数被去掉了。另外优化了CPU占用、存储空间占用等,具体可以看官方文档。

这里贴一下prometheus2.0的联邦(又称Shard)搭建方法,一些理论知识就不贴了,自己去google扒吧:

官网对于联邦的介绍:https://prometheus.io/docs/prometheus/latest/federation/

联邦有不同的用例。它通常用于实现可扩展的prometheus,或者将metrics从一个服务的prometheus拉到另一个Prometheus上用于展示。

分层联邦:

分层联邦允许普罗米修斯扩展到数十个数据中心和数百万个节点的环境。在这种用例中,联邦拓扑类似于一棵树,更高级别的普罗米修斯服务器从大量的从属服务器收集汇总的时间序列数据。

跨服务联邦:

In cross-service federation, a Prometheus server of one service is configured to scrape selected data from another service's Prometheus server to enable alerting and queries against both datasets within a single server.

在跨服务联合中,一个服务的普罗米修斯服务器被配置为从另一个服务的普罗米修斯服务器中刮取选定的数据,以使得能够针对单个服务器内的两个数据集进行警报和查询。

For example, a cluster scheduler running multiple services might expose resource usage information (like memory and CPU usage) about service instances running on the cluster. On the other hand, a service running on that cluster will only expose application-specific service metrics. Often, these two sets of metrics are scraped by separate Prometheus servers. Using federation, the Prometheus server containing service-level metrics may pull in the cluster resource usage metrics about its specific service from the cluster Prometheus, so that both sets of metrics can be used within that server.

例如,运行多个服务的集群调度程序可能会暴露有关在集群上运行的服务实例的资源使用情况信息(如内存和CPU使用情况)。另一方面,在该群集上运行的服务将仅公开特定于应用程序的服务度量标准。通常,这两套指标是由单独的普罗米修斯服务器来抓取的。使用联邦,包含服务级别度量的普罗米修斯服务器可以从集群普罗米修斯拉入有关其特定服务的集群资源使用度量,以便这两组度量可以在该服务器内使用。

【举个例子:我们要监控mysqld的运行状态,可以使用1个主Prometheus+2个分片Prometheus(一个用来采集node_exporter的metrics、一个用来采集mysql_exporter的metrics),然后在主Prometheus上做汇总】

安装prometheus和mysqld_exporter、postgres_exporter的步骤也不写了,很简单的,exporter的部署我们通常用ansible或saltstack之类的工具批量分发。

我这里实验起见,在一台机器上跑了3个shard节点,1个global节点。

Node1: 10.0.20.25 (跑了老版本的prometheus1.7、mysql_exporter、postgres_exporter,这是之前做实验搭建的环境)

Node2: 10.0.20.26 (跑了prometheus2.0、mysql_exporter、postgres_exporter)

以下内容,请参考原文https://blog.51cto.com/lee90/2062252

prometheus2.0 联邦的配置的更多相关文章

  1. 烂泥:zabbix3.0安装与配置

    本文由ilanniweb提供友情赞助,首发于烂泥行天下 想要获得更多的文章,可以关注我的微信ilanniweb 这个月又快过完了,最近也比较忙,没时间写文章,今天挤点时间把zabbix3.0安装与配置 ...

  2. mysql 5.0.46安装配置

    http://os.chinaunix.net/a2008/0801/986/000000986346.shtml RPM包和源码包存放位置 /usr/local/src 源码包编译安装位置(pref ...

  3. win10+vs2015+opencv3.0 x86/x64配置(debug+release)

    最近做一些图像识别的项目,用到了opencv,opencv3.1没有x86版本,所以只能用opencv3.0来完成,下面介绍一下在window10下vs2015 配置opencv3.0的过程(x86和 ...

  4. Tomcat6.0数据库连接池配置

    http://blog.163.com/magicc_love/blog/static/185853662201111101130969/ oracle驱动包Tomcat 6.0配置oracle数据库 ...

  5. cocos2d-x3.0 windows 环境配置

    cocos2d-x3.0 windows 环境配置 参考Oo泡泡糖oO的CSDN博文 :http://blog.csdn.net/u010296979/article/details/24273393 ...

  6. uWSGI参考资料(1.0版本的配置选项列表)

    Reference: http://blog.csdn.net/kevin6216/article/details/15378617 uWSGI参考资料(1.0版本的配置选项列表) 下面的内容包含了大 ...

  7. CentOS-6.6下Tomcat-7.0安装与配置(Linux)

    CentOS-6.6下Tomcat-7.0安装与配置(Linux) 一.认识tomcat Tomcat是一个免费的开源的Serlvet容器,它是Apache基金会的Jakarta项目中的一个核心项目, ...

  8. Redis4.0.0 安装及配置 (Linux — Centos7)

    本文中的两个配置文件可在这里找到 操作系统:Linux Linux发行版:Centos7 安装 下载地址,点这里Redis4.0.0.tar.gz 或者使用命令: wget http://downlo ...

  9. Caffe + Ubuntu 15.04 + CUDA 7.0 安装以及配置

    作为小码农的我,昨天就在装这个东东了,主要参考第一篇博文,但是过程发现很多问题,经过反反复复,千锤百炼,终于柳暗花明,我把这个caffe给搞定了,是故,我发布出来,后之来者,欲将有感于斯文~ 本分分为 ...

随机推荐

  1. SpringBoot之AOP使用

    说到SpringBoot,难免会想到Spring.对于Spring,我曾用其开发过很多大大小小的项目.当使用SpringBoot之后,给人最直观的感受,用古人一句话:”大道至简”. SpringBoo ...

  2. 微信小程序获取当前地理位置

    获取用户地理位置,需要用到以下三个api方法:   wx.getSetting() : 获取用户的授权列表信息 wx.openSetting():调起客户端小程序设置界面 wx.getLocation ...

  3. 【转】linux sed命令

    转自:linux sed命令就是这么简单 参考:Linux三大剑客之sed:https://blog.csdn.net/solaraceboy/article/details/79272344 阅读目 ...

  4. Xamarin.FormsShell基础教程(3)Shell项目构成

    Xamarin.FormsShell基础教程(3)Shell项目构成 在创建的ShellDemo解决方案中,有3个子项目,分别为ShellDemo.ShellDemo.Android和ShellDem ...

  5. PHPUnit 单元测试教程

    一.官网下载对应 PHP 版本的代码库 https://phpunit.de/getting-started-with-phpunit.html 二.安装 PHPUnit 官网提供了两种方法安装 1. ...

  6. Spring @RequestMapping 参数说明

    @RequestMapping 参数说明: value:  指定请求的实际地址, 比如 /action/info之类.method:  指定请求的method类型, GET.POST.PUT.DELE ...

  7. node.js GET与POST请求

    node.js GET与POST请求 转 http://www.voidcn.com/article/p-ncglaiqx-bdx.html 标签 get post node.js 栏目 Node.j ...

  8. Mysql创建数据库以及用户分配权限

    一.创建mysql数据库 1.创建数据库语法 --创建名称为“testdb”数据库,并设定编码集为utf8 CREATE DATABASE IF NOT EXISTS testdb DEFAULT C ...

  9. scrapy爬虫案例:问政平台

    问政平台 http://wz.sun0769.com/index.php/question/questionType?type=4 爬取投诉帖子的编号.帖子的url.帖子的标题,和帖子里的内容. it ...

  10. 请关注订阅号,获取demo,学术讨论