广告
返回顶部
首页 > 资讯 > 后端开发 > Python >Prometheus分布式监控
  • 342
分享到

Prometheus分布式监控

分布式Prometheus 2023-01-31 08:01:34 342人浏览 八月长安

Python 官方文档:入门教程 => 点击学习

摘要

prometheus安装在阿里云上面,监控节点在公司内部机房,2个网络直接是不互通的。环境说明阿里云服务器:操作系统:Centos 7.6数量:1台 公司内部服务器操作系统:centos 7.6数量:1台 拓扑图&nbs

prometheus安装在阿里云上面,监控节点在公司内部机房,2个网络直接是不互通的。

环境说明

阿里云服务器

操作系统Centos 7.6

数量:1台

 

公司内部服务器

操作系统:centos 7.6

数量:1台

 

拓扑图

1.png

 

 说明:

1. 公司内部服务器安装node-exporter插件,收集主机信息,通过调用curl命令,将收集的数据以POST方式发送给Pushgateway

2. Pushgateway负责接收数据

3. Prometheus从Pushgateway中拉取数据,结合Grafana做数据展示。

 

阿里云服务器

Prometheus和Pushgateway,是直接Docker部署的。具体安装操作,请参考链接:

https://www.cnblogs.com/xiao987334176/p/9930517.html

Https://www.cnblogs.com/xiao987334176/p/9933963.html

 

这里重点要说明的是Prometheus配置Pushgateway时,必须要加一个参数honor_labels: true

- job_name: 'pushgateway'
    honor_labels: true
    static_configs:
      - targets: ['172.18.156.172:9091']
        labels:
          instance: xxx

如果不加,会造成推送给Pushgateway的instance和job全部加了"exported_"前缀。

那么在Grafana现有的模板中,无法展示推送到Pushgateway的数据。

 

公司内部服务器

安装node-exporter

这里推荐使用二进制方式

wget https://GitHub.com/prometheus/node_exporter/releases/download/v0.18.1/node_exporter-0.18.1.linux-amd64.tar.gz
tar zxvf node_exporter-0.18.1.linux-amd64.tar.gz -C /data/
mv /data/node_exporter-0.18.1.linux-amd64 /data/node_exporter

封装service

vi /etc/systemd/system/node-exporter.service

内容如下:

[Unit]
Description=Prometheus Node Exporter
After=network.target
[Service]
ExecStart=/data/node_exporter/node_exporter
[Install]
WantedBy=multi-user.target

注意:主要修改ExecStart和User

 

设置开机自启动

systemctl daemon-reload
systemctl enable node-exporter
systemctl start node-exporter

查看端口

# ss -tuNLP|grep node
tcp    LISTEN     0      128      :::9100                 :::*                   users:(("node_exporter",pid=990,fd=3))

备注

node-exporter也可以使用docker方式安装,但是收集磁盘数据时,它采集的数据和真实物理主机是不一样的。

比如执行:df -hT

1.png

 

可能会比真实的多几个目录。

因此,我还是推荐使用二进制方式安装,这样数据会比较准确一点。

 

发送POST请求

将node_exporter收集到的数据传送监控数据到pushgateway

对于传过去的监控项会添加此处定义的标签 job=node_exporter instance=北京三里屯  hostname=192.168.2.45

curl 127.0.0.1:9100/metrics|curl --data-binary @- http://114.114.114.114:9091/metrics/job/node_exporter/instance/北京三里屯/hostname/192.168.2.45

 

访问pushgateway页面

http://114.114.114.114:9091

效果如下:

1.png

 

 

 访问Grafana,查看主机信息

1.png

 

 

 

本文参考链接:

https://www.cnblogs.com/huandada/p/10932953.html

https://www.jianshu.com/p/51b9338d98b0


--结束END--

本文标题: Prometheus分布式监控

本文链接: https://www.lsjlt.com/news/193696.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

本篇文章演示代码以及资料文档资料下载

下载Word文档到电脑,方便收藏和打印~

下载Word文档
猜你喜欢
  • Prometheus分布式监控
    prometheus安装在阿里云上面,监控节点在公司内部机房,2个网络直接是不互通的。环境说明阿里云服务器:操作系统:centos 7.6数量:1台 公司内部服务器操作系统:centos 7.6数量:1台 拓扑图&nbs...
    99+
    2023-01-31
    分布式 Prometheus
  • prometheus 监控docker
    cAdvisor(Container Advisor)用于收集正在运行的容器资源使用和性能信息。使用Prometheus监控cAdvisorcAdvisor将容器统计信息公开为Prometheus指标。默认情况下,这些指标在/metrics...
    99+
    2023-01-31
    prometheus docker
  • Prometheus监控PHP-FPM
    启用php-fpm状态功能php-fpm和nginx一样内建了一个状态页,对于想了解php-fpm的状态以及监控php-fpm非常有帮助。为了后续的Prometheus监控,我们需要先了解php-fpm状态页是怎么回事。在上一篇文章中,已经...
    99+
    2023-01-31
    Prometheus PHP FPM
  • 【无监控,不运维】监控之Prometheus
    文章目录 一、常用监控简介1.cacti2.Nagios3.Zabbix3.1 zabbix的构成3.2 zabbix的优点和缺点3.3 zabbix核心组件介绍 二、Prometh...
    99+
    2023-09-01
    运维 prometheus php
  • Prometheus MySQL 性能监控
    一、 介绍 Prometheus 是一种开源的监控系统和时序数据库,旨在收集和处理大量数据并提供可视化、监控警报等功能。它支持多种语言、多种部署方式,并且非常灵活,而且社区支持非常活跃,为用户提供了很...
    99+
    2023-09-01
    mysql prometheus 数据库
  • Prometheus监控PHP应用
    文章目录 1、配置PHP-FPM,暴露php-fpm状态信息2、bakins/php-fpm-exporter监控PHP应用2.1、配置php状态页的http访问2.2、下载bakins/ph...
    99+
    2023-08-31
    php prometheus 服务器
  • Zabbix 3.0 分布式监控 [九]
    Zabbix 3.0 分布式监控 [九]Zabbix 3.0 分布式监控 [九]2016年10月11日 zabbix 笔者QQ:381493251   Zabbix Proxy是一个类似于代理的服务,可以代...
    99+
    2022-10-18
  • PinPoint分布式全链路监控
    PinPoint分布式全链路监控安装需要的所有包下载路径:链接: https://pan.baidu.com/s/1sl9dP9r 密码: jsux介绍:   PinPoint是一个开源...
    99+
    2022-10-18
  • prometheus监控nginx的实现
    目录简述1.下载nginx-module-vts模块2.安装nginx3.安装nginx-vts-exporter4.修改prometheus-cfg.yaml文件5.在grafan...
    99+
    2022-11-13
  • 使用Prometheus+Grafana监控JVM
    JMX Exporterhttps://github.com/prometheus/jmx_exporter它是Prometheus官方组件,作为一个JAVA Agent来提供本地JVM的metrics,并通过http暴露出来。这也是官方推...
    99+
    2023-01-31
    Prometheus Grafana JVM
  • prometheus+grafana如何监控nginx
    这篇文章主要介绍prometheus+grafana如何监控nginx,文中介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们一定要看完!在prometheus需要向ngxin中打入探针,通过探针获取ngxin信息,并通过接口输出。下文将...
    99+
    2023-06-21
  • grafana、prometheus监控linux、mysql等
    监控安装部署 监控安装下载所需包:  下载地址:Download | Prometheus Grafana下载 官网下载Download Grafana | Grafana Labs(速度较慢) 国内镜像Grafana 国内加速下载 | ...
    99+
    2023-08-31
    linux mysql grafana prometheus
  • 利用Prometheus和Grafana监控MySQL
     一、 Prometheus 是一个开源的服务监控系统和时间序列数据库。:官方GitHub地址为:https://github.com/prometheus/prometheus 官方地...
    99+
    2022-10-18
  • Prometheus、Alertmanager、Grafana 监控 Linux 与 MySQL
    //检查各个端口的放行 //部署各个模块与应用 cd /usr/local/Prometheus_compose vim docker-compose.yml version: "3" services: prom: imag...
    99+
    2017-01-04
    Prometheus Alertmanager Grafana 监控 Linux MySQL 数据库入门 数据库基础教程 数据库 mysql
  • SpringBoot如何使用prometheus监控
    这篇文章主要介绍SpringBoot如何使用prometheus监控,文中介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们一定要看完!1.关于PrometheusPrometheus是一个根据应用的metrics来进行监控的开源工具。相...
    99+
    2023-06-14
  • Prometheus如何监控Springboot程序
    这篇文章主要介绍Prometheus如何监控Springboot程序,文中介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们一定要看完!1. 添加依赖我本次使用的Springboot版本为1.5.12.RELEASE,如果是Springb...
    99+
    2023-06-14
  • Prometheus监控运维实战十: 主机监控指标
    1、CPU指标 CPU负载 node_load1node_load5node_load15 以上三个指标为主机的CPU平均负载,分别对应一分钟、五分钟和十五分钟的时间间隔。CPU负载是指某段时间内占用...
    99+
    2023-09-12
    运维 prometheus 服务器
  • Prometheus 监控MySQL使用grafana展示
    目录prometheus通过exporter监控mysql,并用grafana图表展示1、测试机器 2、配置mysql host013、创建exporter帐号4、下载,安...
    99+
    2022-11-12
  • Grafana+Prometheus如何监控MySql服务
    这篇文章主要为大家展示了“Grafana+Prometheus如何监控MySql服务”,内容简而易懂,条理清晰,希望能够帮助大家解决疑惑,下面让小编带领大家一起研究并学习一下“Grafana+Prometh...
    99+
    2022-10-18
  • 5分钟搭建MySQL监控平台(mysql-exporter+Prometheus+Grafana)
      一、工具介绍 Prometheus:   普罗米修斯可以简单理解为一个监控工具,以时间为单位展示指定数据维度的变化 趋势。 mysqld_exporter :主要是依赖数据采集器,对于mysql数据采集使用的是mysqld_...
    99+
    2023-09-16
    prometheus grafana
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作