[TOC] ## 一、安装prometheus 1.1 下载及上传prometheus安装包 下载当前最新prometheus的2.23.0版本,地址:https://prometheus.io/download/ 解压 ``` tar -zxvf prometheus-2.23.0.linux-amd64.tar.gz ``` 1.2 修改配置文件 ``` vi /gpe/prometheus-2.23.0.linux-amd64/prometheus.yml ``` 1.3 启动 ``` cd prometheus-2.23.0.linux-amd64 nohup ./prometheus --config.file=prometheus.yml >/dev/null & ``` 1.4 验证 可以通过http://ip:9090访问浏览器,或者http://ip:9090/metrics看是否能提供关于自身的各项指标 ## 二、安装grafana 2.1 下载及上传grafana安装包 下载当前最新grafana的7.3.4版本,地址:https://grafana.com/grafana/download 解压 ``` tar -zxvf grafana-7.3.4.linux-amd64.tar.gz ``` 2.2 启动 ``` cd grafana-7.3.4 nohup ./bin/grafana-server web >/dev/null & ``` 2.3 验证 访问浏览器http://ip:3000, 默认的账号密码为: admin / admin,登录后会要求修改密码 ## 三、进入系统 第一次登录系统会要求输入新的密码,之后添加数据源Prometheus ![](https://img.kancloud.cn/22/8b/228bb483b7cbdb8ad5f46252f3895325_1920x561.png) ![](https://img.kancloud.cn/00/33/00334af7832780f9e5b2556b25fcb4ac_1155x453.png) ![](https://img.kancloud.cn/69/b3/69b3739f70dca458e1a7b2c7d169b040_831x900.png)