安装所需插件:
What is Prometheus?
Prometheus是最初在SoundCloud上构建的开源系统监视和警报工具包。 自2012年成立以来,许多公司和组织都采用了Prometheus,该项目拥有非常活跃的开发人员和用户社区。
现在,它是一个独立的开源项目,并且独立于任何公司进行维护。 为了强调这一点并阐明项目的治理结构,Prometheus在2016年加入了Cloud Native Computing Foundation,这是继Kubernetes之后的第二个托管项目。
功能特性
- 一个多维数据模型,其中包含通过度量标准名称和键/值对标识的时间序列数据
- PromQL,一种灵活的查询语言,可利用此维度
- 不依赖分布式存储;单个服务器节点是自治的
- 时间序列收集通过HTTP上的拉模型进行
- 通过中间网关支持推送时间序列
- 通过服务发现或静态配置发现目标
- 多种图形和仪表板支持模式
组件
- Prometheus主服务器,它会刮取并存储时间序列数据
- 客户端库,用于检测应用程序代码
- 一个支持短期工作的推送网关
- 专用出口商,用于诸如HAProxy,StatsD,Graphite等的服务。
- 警报经理以处理警报
- 各种支持工具
结构图

安装部署Prometheus
下载Prometheus:Download | Prometheus
https://prometheus.io/download/
进入文件夹,解压。
[root@localhost updates]# tar -xf prometheus-2.19.3.linux-amd64.tar.gz
[root@localhost updates]# mv prometheus-2.19.3.linux-amd64/ ../prometheus
[root@localhost home]# cd prometheus/
[root@localhost prometheus]#./prometheus --version
prometheus, version 2.19.3
(branch: HEAD, revision: 657ba532e42f1db8d7c77bf802378643da0d3118)
build user:root@b99e50bced7c
build date:20200724-12:20:53
go version:go1.14.6
./prometheus --help查看相关用法。
修改prometheus.yml文件,确定启动ip
[root@localhost prometheus]# vim
prometheus.yml
配置文件补全后如下:
# my global
config
global:
scrape_interval:15s # Set the scrape interval to every 15
seconds. Default is every 1 minute.
evaluation_interval: 15s # Evaluate rules
every 15 seconds. The default is every 1 minute.
# scrape_timeout is set to the global default
(10s).
#
Alertmanager configuration
alerting:
alertmanagers:
- static_configs:
- targets:
# - alertmanager:9093
# Load rules
once and periodically evaluate them according to the global 'evaluation_interval'.
rule_files:
# - "first_rules.yml"
# - "second_rules.yml"
# A scrape
configuration containing exactly one endpoint to scrape:
# Here it&#

本文介绍了如何使用Prometheus监控Greenplum数据库,并结合Grafana进行可视化展示。首先,详细讲述了Prometheus的安装、配置以及其组件,接着部署了node_exporter和greenplum_exporter以收集数据库指标。最后,阐述了Grafana的安装过程,以及如何导入dashboard来展示监控数据。
最低0.47元/天 解锁文章
1万+

被折叠的 条评论
为什么被折叠?



