​前言

昨天安装和配置好了Prometheus,它还可以显示一些数据,但显示的不够漂亮。现在我们将安装 grafana软件以显示的更漂亮一些。

安装Grafana

从 Grafana官网下载软件包,这里选择7.37开源版本。

CENTER_PostgreSQL_Community

tar -xzvf grafana-7.3.7.linux-amd64.tar
cd grafana-7.3.7
bin/grafana-server &

直接解压软件。下面是运行日志。

CENTER_PostgreSQL_Community

此处的防火墙需要打开3000端口。

[root@centos8 ~]# firewall-cmd --add-port=3000/tcp --permanent   
success
[root@centos8 ~]# firewall-cmd --reload
success

可以通过http://192.168.56.125:3000/的方式访问Grafana。默认情况下,用户名和密码都是admin。

CENTER_PostgreSQL_Community

登陆之后,首先需要配置数据源,确定显示的数据是从哪个数据源获得的。

CENTER_PostgreSQL_Community

在此添加数据源选择 Prometheus。还可以选择诸如 OpenTSDB, InfluxDB等时序数据库。

CENTER_PostgreSQL_Community

填写Prometheus的http url,指定数据源。

CENTER_PostgreSQL_Community

点击Save & Test,显示Data source is working则正常。

CENTER_PostgreSQL_Community

然后是Create Dashboard。

CENTER_PostgreSQL_Community

可从模板导入。模板可以在Grafana Lab网站上下载。https://grafana.com/grafana/dashboards?plcmt=footer。您可以在这里选择你喜欢的模板。

CENTER_PostgreSQL_Community

我随便下载了一个,文件名叫postgresql-database_rev6.json。接着我们进入导入文件的界面。

CENTER_PostgreSQL_Community

在导入的选项里面,可以设置面板的名字、文件夹。DS_PROMETHEUS这里选择Prometheus。

CENTER_PostgreSQL_Community

导入完成您将看到漂亮的数据库监控。

CENTER_PostgreSQL_Community

CENTER_PostgreSQL_Community

CENTER_PostgreSQL_Community

后记

Prometheus+ Grafana监控 PostgreSQL已经搭好。建立这套监控系统很简单。当然,这些指标只是基本指标,如果要定制一些SQL获取监控指标,还需要在客户端进行配置。

PostgreSQL中文社区欢迎广大技术人员投稿

投稿邮箱:press@postgres.cn

请在登录后发表评论,否则无法保存。
1楼 xcvxcvsdf
2024-10-12 11:04:42+08

https://huangshan.tiancebbs.cn/qths/474208.html https://www.tiancebbs.cn/ershoufang/469958.html https://aihuishou.tiancebbs.cn/sh/1172.html https://aihuishou.tiancebbs.cn/sh/1248.html https://zulin.tiancebbs.cn/sh/3962.html https://su.tiancebbs.cn/hjzl/456420.html https://changshushi.tiancebbs.cn/hjzl/458620.html https://aihuishou.tiancebbs.cn/sh/3671.html https://changshushi.tiancebbs.cn/hjzl/458606.html https://sh.tiancebbs.cn/hjzl/461315.html https://zulin.tiancebbs.cn/sh/1771.html https://zulin.tiancebbs.cn/sh/1296.html https://aihuishou.tiancebbs.cn/sh/2916.html https://taicang.tiancebbs.cn/hjzl/461270.html https://www.tiancebbs.cn/ershouwang/468684.html https://taicang.tiancebbs.cn/hjzl/461280.html https://zulin.tiancebbs.cn/sh/2906.html

2楼 xiaowu
2024-09-11 07:14:37+08

如果没有作文:https://www.deipei.com/zuowen/1045.html 刑事附带民事起诉状:https://www.deipei.com/fanwen/1441.html 安全施工日志:https://www.deipei.com/gongzuo/1040.html 项目工作总结:https://www.deipei.com/zongjie/1485.html 忏悔录读后感:https://www.deipei.com/duhougan/1220.html 出资证明书:https://www.deipei.com/fanwen/1319.html 党员大会主持词:https://www.deipei.com/yanjianggao/1264.html 服务质量承诺书:https://www.deipei.com/fanwen/1207.html 调研提纲:https://www.deipei.com/gongzuo/1114.html 五年级数学小论文:https://www.deipei.com/zuowen/1215.html 小学数学论文:https://www.deipei.com/xuexi/1052.html 六个检视问题清单及整改措施:https://www.deipei.com/zongjie/1279.html 社区矫正人员每月思想汇报:https://www.deipei.com/fanwen/1281.html 为了这份繁华作文:https://www.deipei.com/zuowen/1038.html 软件测试报告:https://www.deipei.com/shixibaogao/1383.html 工作证明模板:https://www.deipei.com/fanwen/1397.html 尊师重教演讲稿:https://www.deipei.com/yanjianggao/1300.html 健康成长心得体会:https://www.deipei.com/xindetihui/1194.html 安全生产论文:https://www.deipei.com/xuexi/1150.html 运动员致辞:https://www.deipei.com/fanwen/1482.html 我眼中的李清照:https://www.deipei.com/zuowen/1227.html 争先创优方案:https://www.deipei.com/fangan/1134.html 廉政教育心得体会:https://www.deipei.com/xindetihui/1292.html 大学生自我介绍:https://www.deipei.com/ziwojianding/1404.html 企划书模板:https://www.deipei.com/jihua/1219.html 巡检报告:https://www.deipei.com/shuzhibaogao/1445.html 班级目标:https://www.deipei.com/gongzuo/1053.html 大学计划:https://www.deipei.com/xuexi/1147.html 指导记录:https://www.deipei.com/xuexi/1095.html 部门规划:https://www.deipei.com/jihua/1312.html

© 2010 PostgreSQL中文社区