Prometheus(普罗米修斯)和grafana监控的安装和使用

前言

这一篇记录并不是详细的使用方法,因为在开始学习普罗米修斯的时候找的文档都不满意,后来才找到了中文手册,所以在这里记录一下,也给有需要的人。

这里需要提一点文档中说道的:”Prometheus Server并不直接服务监控特定的目标,其主要任务负责数据的收集,存储并且对外提供数据查询支持。因此为了能够能够监控到某些东西,如主机的CPU使用率,我们需要使用到Exporter。Prometheus周期性的从Exporter暴露的HTTP服务地址(通常是/metrics)拉取监控样本数据。“ 

安装

安装时的系统是mac,其他系统可以参考文档里的内容

#安装prometheus
brew install prometheus
#启动
brew services start prometheus
#访问:
http://localhost:9090

#安装node exporter
curl -OL https://github.com/prometheus/node_exporter/releases/download/v0.15.2/node_exporter-0.15.2.darwin-amd64.tar.gz
tar -zxf node_exporter-0.15.2.darwin-amd64.tar.gz -C /usr/local
cp node_exporter /usr/local/bin
#启动
http://localhost:9100


#安装grafana
brew install grafana
#启动
brew services start grafana
#访问
http://localhost:3000

 

中文手册地址

https://yunlzheng.gitbook.io/prometheus-book/

posted @ 2021-08-22 17:10  不吃陈皮  阅读(971)  评论(0编辑  收藏  举报