|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
 
                    
                 
                
            
         浙公网安备 33010602011771号
浙公网安备 33010602011771号