数据库监控 Prometheus + Grafana

本文介绍了如何使用Prometheus监控Greenplum数据库,并结合Grafana进行可视化展示。首先,详细讲述了Prometheus的安装、配置以及其组件,接着部署了node_exporter和greenplum_exporter以收集数据库指标。最后,阐述了Grafana的安装过程,以及如何导入dashboard来展示监控数据。
摘要由CSDN通过智能技术生成

安装所需插件:

What is Prometheus?

Prometheus是最初在SoundCloud上构建的开源系统监视和警报工具包。 自2012年成立以来,许多公司和组织都采用了Prometheus,该项目拥有非常活跃的开发人员和用户社区。
现在,它是一个独立的开源项目,并且独立于任何公司进行维护。 为了强调这一点并阐明项目的治理结构,Prometheus在2016年加入了Cloud Native Computing Foundation,这是继Kubernetes之后的第二个托管项目。

功能特性

  1. 一个多维数据模型,其中包含通过度量标准名称和键/值对标识的时间序列数据
  2. PromQL,一种灵活的查询语言,可利用此维度
  3. 不依赖分布式存储;单个服务器节点是自治的
  4. 时间序列收集通过HTTP上的拉模型进行
  5. 通过中间网关支持推送时间序列
  6. 通过服务发现或静态配置发现目标
  7. 多种图形和仪表板支持模式

组件

  1. Prometheus主服务器,它会刮取并存储时间序列数据
  2. 客户端库,用于检测应用程序代码
  3. 一个支持短期工作的推送网关
  4. 专用出口商,用于诸如HAProxy,StatsD,Graphite等的服务。
  5. 警报经理以处理警报
  6. 各种支持工具

结构图

安装部署Prometheus

下载Prometheus:Download | Prometheusicon-default.png?t=L892https://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&#
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值