|NO.Z.00294|——————————|CloudNative|——|KuberNetes&運維.V15|-----------------------------------------------------------|監控.v01|Prometheus概述|3臺Server|
阿新 • • 發佈:2022-03-31
[CloudNative:KuberNetes&運維.V15] [Applications.KuberNetes] [|**3節點.V1**|部署helm和ingress|Prometheus安裝級入門|部署operator/alert/grafana|]
一、Prometheus介紹
二、在生產環境中怎麼安裝Prometheus### --- Prometheus簡介 ~~~ 在容器中使用的監控是Prometheus,容器的監控更復雜,更具有動態性,它的動態性更強。 ~~~ 使用傳統的監控方式,可能不是很適合;所以就衍生了專屬監控容器的監控工具 ~~~ Prometheus監控容器是做的非常好的監控工具 ~~~ Prometheus本身是一個時間序列資料庫,用來採集資料存到本地的。 ~~~ 然後把這個資料展示給Prometheus的UI ~~~ Prometheus可以基於demon程序去安裝,也可以通過二進位制的方式安裝; ~~~ 也可以基於容器去安裝 ~~~ 此環境基於operator去安裝;通過operator安裝還是比較簡單的,自定義監控比較簡單
三、Prometheus的原始碼地址:### --- 在生產環境中怎麼安裝Prometheus ~~~ 建議是基於容器去安裝 ~~~ 最好的方式是:給Prometheus找一些專用的節點, ~~~ 比如說起3個Prometheus的pod,就找3個Prometheus的專用節點,專門用來跑Prometheus的服務 ~~~ Prometheus會把採集的資料儲存到本地,也可以儲存到遠端的時間序列資料庫 ~~~ 儲存到本地的話,假設啟動了3個副本的Prometheus,就會儲存3份資料, ~~~ 若是這3個Prometheus連線的是遠端的時間序列資料庫的話, ~~~ 就是儲存一個數據;就需要多維護一個時間序列資料庫 ~~~ 大部分的安裝方式都是採用本地的安裝方式,本地的讀寫的速度是非常快的, ~~~ 若是採用遠端的話連線過程可能會有一定的損耗。
### --- prometheus原始碼地址:
~~~~ ——> https://github.com/prometheus-operator/prometheus-operator
~~~~ 通過operator衍生出來kube-prometheus
### --- kube-prometheus原始碼地址:
~~~~ ——> https://github.com/prometheus-operator/kube-prometheus
### --- Prometheus和Prometheus-operator的區別是什麼 ~~~~ # prometheus-operator:安裝完之後就只有一個operator,自定義了一些CRD, ~~~ 需要手動的定義去建立各種監控 ~~~~ # kube-prometheus:包含了很多已有的監控,有很多自定義的監控, ~~~ 基本的監控不需要我們手動去新增
### --- kube-prometheus:包含的監控模板
~~~~ Prometheus Operator: Prometheus 的operator
~~~~ Highly available Prometheus: 高可用的Prometheus
~~~~ Highly available Alertmanager: 高可用的Alertmanager;告警用的
~~~~ Prometheus node-exporter: node的節點監控
~~~~ Prometheus Adapter for Kubernetes Metrics APIs: adapter
~~~~ kube-state-metrics: 這個元件也安裝好了,監控每個deployment起了多少個副本,每個容器狀態是什麼樣的,都是它來提供的
~~~~ GrafanaL: 用來展示資料的
===============================END===============================
Walter Savage Landor:strove with none,for none was worth my strife.Nature I loved and, next to Nature, Art:I warm'd both hands before the fire of life.It sinks, and I am ready to depart ——W.S.Landor
來自為知筆記(Wiz)