zoukankan      html  css  js  c++  java
  • prometheus2.0 联邦的配置

    参考: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

  • 相关阅读:
    Linux实时性分析-schedule-调度器
    中断解析
    网络商城-PrestaShop
    和学生的学习互动记录(10嵌)
    QQ记录
    Windows7硬盘安装Fedora16图文教程
    今目标登录时报网络错误E110
    vs环境配置——vs快捷键配置——vs插件配置——vs环境设置
    如何防止app接口被别人调用
    mvc4 找到多个与名为“xx”的控制器匹配的类型
  • 原文地址:https://www.cnblogs.com/robinunix/p/11151378.html
Copyright © 2011-2022 走看看