天天看點

prometheus+grafana簡介與linux下的安裝

prometheus+grafana簡介與linux下的安裝

1.簡介

prometheus+grafana為一份監控平台的解決方案。其中可以監控linux伺服器,nginx,rabbitmq,springboot項目等,功能非常強大。

prometheus負責在被監控中間件或系統中打入探針(需要安裝exporter),同時提供接口對外提供監控資料。

grafana主要為顯示頁面,其中提供了海量的面闆,可以自由擷取json檔案,樣子非常酷炫。

grafana連接配接prometheus後,調用prometheus提供的接口擷取資料,同時填寫在模闆中,并顯示。

2.下載下傳

由于網絡原因,自己樓主自己提供網盤位址,怼就完事了。

prometheus

連結:

https://pan.baidu.com/s/13VVo3oAC1PHxIyZLQvgtuw

提取碼:rfo0

go

https://pan.baidu.com/s/1Z8b_xzgTMRT45uuP9SuZ8A

提取碼:2j3v

grafana

https://pan.baidu.com/s/11QJa4CjjY1-08hAMi9YWng

提取碼:az3w

3.安裝go

1.解壓安裝

tar -C /usr/local/ -xvf go1.11.4.linux-amd64.tar.gz      

2.配置環境變量

vim /etc/profile
export PATH=$PATH:/usr/local/go/bin
source /etc/profile      

3.驗證

go version      

4.安裝Prometheus

1.安裝

tar -C /usr/local/ -xvf prometheus-2.6.0.linux-amd64.tar.gz
ln -sv /usr/local/prometheus-2.6.0.linux-amd64/ /usr/local/Prometheus      

2.啟動

普羅米修斯預設配置檔案,vim /usr/local/Prometheus/prometheus.yml(預設背景啟動)。

/usr/local/Prometheus/prometheus --config.file=/usr/local/Prometheus/prometheus.yml &      

浏覽器打開IP:9090端口即可打開普羅米修斯自帶的監控頁面。

prometheus+grafana簡介與linux下的安裝

5.安裝Grafana

1.安裝(隻能使用此種方法安裝 否則Grafana指令是不好用的)

rpm -ivh --nodeps grafana-7.1.5-1.x86_64.rpm      

sudo /bin/systemctl daemon-reload
sudo /bin/systemctl enable grafana-server.service
sudo /bin/systemctl start grafana-server.service
### 3.通路grafana
浏覽器通路IP:3000端口,即可打開grafana頁面,預設使用者名密碼都是admin,初次登入會要求修改預設的登入密碼,出現以下頁面安裝成功。
![在這裡插入圖檔描述](https://img-blog.csdnimg.cn/268778563b6742f79bf03f559ef2cc41.png)