|NO.Z.00009|——————————|Deployment|——|Hadoop&EbProjec电商实时数仓项目.v09|——|EbProject.v09|可视化&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
分类:
dov002-EB实时数仓
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· DeepSeek 开源周回顾「GitHub 热点速览」