|NO.Z.00064|——————————|^^ 部署 ^^|——|Hadoop&实时数仓.V04|——|可视化.v04|监控:pushgateway部署.V4|

一、部署pushgateway:
### --- pushgateway
~~~     Pushgateway 是 Prometheus 生态中一个重要工具,使用它的原因主要是:
~~~     Prometheus 采用 pull 模式,可能由于不在一个子网或者防火墙原因,
~~~     导致 Prometheus 无法直接拉取各个target 数据。
~~~     在监控业务数据的时候,需要将不同数据汇总, 由 Prometheus 统一收集。

~~~     # 由于以上原因,不得不使用 pushgateway,但在使用之前,有必要了解一下它的一些弊端:
~~~     将多个节点数据汇总到 pushgateway, 如果 pushgateway 挂了,受影响比多个 target 大。
~~~     Prometheus 拉取状态 up 只针对 pushgateway, 无法做到对每个节点有效。
~~~     Pushgateway 可以持久化推送给它的所有监控数据。
~~~     因此,即使你的监控已经下线,prometheus 还会拉取到旧的监控数据,
~~~     需要手动清理 pushgateway 不要的数据。
### --- 拓扑图如下:
### --- 下载:https://prometheus.io/download/#pushgateway/
二、部署Pushgateway
### --- 下载Pushgateway版本包

~~~     # 下载Pushgateway版本包
[root@hadoop00 software]# wget https://github.com/prometheus/pushgateway/releases/download/v1.3.0/pushgateway-1.3.0.linux-amd64.tar.gz
### --- 解压Pushgateway版本包

~~~     # 解压Pushgateway版本包
[root@hadoop00 software]# tar -zxvf pushgateway-1.3.0.linux-amd64.tar.gz -C ../servers/
~~~     # 修改Pushgateway版本包名称
[root@hadoop00 servers]# mv pushgateway-1.3.0.linux-amd64/ pushgateway
### --- 为Pushgateway目录增加可执行权限

~~~     # 为Pushgateway目录增加可执行权限
[root@hadoop00 ~]# chmod +x /opt/yanqi/servers/pushgateway/
[root@hadoop00 ~]# chown -R root:root /opt/yanqi/servers/pushgateway/
### --- 增加pushgateway的job到prometheus中:

~~~     # 在prometheus.yml配置文件增加Pushgateway.job
[root@hadoop00 ~]# vim /opt/yanqi/servers/prometheus/prometheus.yml
   - job_name: 'bigdata-pushgateway'
    static_configs:
    - targets: ['hadoop00:9091']
### --- 启动Pushgateway服务
### --- 通过web-UI访问Pushgateway服务:http://hadoop00:9091

~~~     # 启动Pushgateway服务
[root@hadoop00 ~]# /opt/yanqi/servers/pushgateway/pushgateway
三、在prometheus-web-UI下查看Pushgateway服务是否监控到
通过web-UI查看Pushgateway服务是否监控到

 
 
 
 
 
 
 
 
 

Walter Savage Landor:strove with none,for none was worth my strife.Nature I loved and, next to Nature, Art:I warm'd both hands before the fire of life.It sinks, and I am ready to depart
                                                                                                                                                   ——W.S.Landor

 

 

posted on   yanqi_vip  阅读(26)  评论(0编辑  收藏  举报

相关博文:
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· DeepSeek 开源周回顾「GitHub 热点速览」
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

导航

统计

点击右上角即可分享
微信分享提示