1. 程式人生 > 其它 >Prometheus(普羅米修斯)和grafana監控的安裝和使用

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/


Shopee(蝦皮)內推點選此處,崗位多多地,薪資高高地



轉載請註明出處