Prometheus ububtu安装
普罗米修斯是一款开源的监控报警工具,下面介绍在linux的安装过程
环境准备
环境 | 版本 |
---|---|
操作系统 | ubuntu16.04 |
Prometheus | 2.2.1 |
GO | 1.8.3 |
Grafana | 5.2.3 |
go环境安装
Prometheus需要go语言环境,先安装go
tar -xzf go1.8.3.linux-amd64.tar.gz -C /usr/local/
配置环境变量
vi ~/.bashrc
添加最后两行
export GOPATH=/usr/local/go
export PATH=$GOPATH/bin:$PATH
环境变量生效
source ~./bashrc
验证
go version
Prometheus安装
安装
tar -xzf prometheus-2.2.1.linux-amd64.tar.gz -C /usr/local/
ln -s /usr/local/prometheus-2.2.1.linux-amd64/ /usr/local/prometheus
启动
使用Prometheus默认配置启动
/usr/local/prometheus/prometheus --config.file=/usr/local/prometheus/prometheus.yml &
验证,打开浏览器访问9090端口
![](https://i.imgur.com/Drnsijg.png)
Grafana安装
通过Grafana作为Prometheus的监控面板
安装
wget https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana-5.2.3-1.x86_64.rpm
rpm -ivh --nodeps grafana-5.2.3-1.x86_64.rpm
启动
sudo /bin/systemctl daemon-reload
sudo /bin/systemctl enable grafana-server.service
sudo /bin/systemctl start grafana-server.service
访问
浏览器访问3000端口
![](https://i.imgur.com/4rrNgUS.png)
![](https://i.imgur.com/dnNCTdL.png)
配置
![](https://i.imgur.com/mEz2W9p.png)
![](https://i.imgur.com/ckFqKr2.png)
<img src=“https://i.imgur.com/8o6zlcT.png” height="340"width=“760” />