溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點(diǎn)擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

基于prometheus11-k8s-node實(shí)現(xiàn)節(jié)點(diǎn)監(jiān)控

發(fā)布時(shí)間:2020-05-11 13:47:51 來源:億速云 閱讀:319 作者:Leah 欄目:系統(tǒng)運(yùn)維

今天小編就為大家?guī)硪黄趐rometheus11-k8s-node實(shí)現(xiàn)節(jié)點(diǎn)監(jiān)控的文章。小編覺得挺不錯(cuò)的,為此分享給大家做個(gè)參考。一起跟隨小編過來看看吧。

1.node接點(diǎn)部署node_exporter

wget  https://github.com/prometheus/node_exporter/releases/download/v0.18.1/node_exporter-0.18.1.linux-amd64.tar.gz

2. promethesus用戶啟動 每用戶的加上

mv node_exporter-0.18.1.linux-amd64  /usr/local/node_exporter[root@zabbix-server system]# cat node_exporter.service[Unit]Description=node_exporter
Documentation=https://prometheus.io/
After=network.target[Service]Type=simple
User=prometheus
ExecStart=/usr/local/node_exporter/node_exporter
Restart=on-failure[Install]WantedBy=multi-user.target[root@zabbix-server system]# pwd/usr/lib/systemd/system

systemctl  daemon-reload
systemctl start node_exporter

3.查看metrics

基于prometheus11-k8s-node實(shí)現(xiàn)節(jié)點(diǎn)監(jiān)控

4. 編輯prometheus的配置文件  并運(yùn)用

基于prometheus11-k8s-node實(shí)現(xiàn)節(jié)點(diǎn)監(jiān)控

prometheus-configmap.yaml
kubectl apply -f prometheus-configmap.yaml

5.查看prometheus監(jiān)控

基于prometheus11-k8s-node實(shí)現(xiàn)節(jié)點(diǎn)監(jiān)控

6.添加模板 9276

基于prometheus11-k8s-node實(shí)現(xiàn)節(jié)點(diǎn)監(jiān)控

7.添加

基于prometheus11-k8s-node實(shí)現(xiàn)節(jié)點(diǎn)監(jiān)控

8.查看儀表盤  有些數(shù)值沒出來 自己edit選項(xiàng)調(diào)整下 即可 調(diào)整下都會出來的  

基于prometheus11-k8s-node實(shí)現(xiàn)節(jié)點(diǎn)監(jiān)控


基于prometheus11-k8s-node實(shí)現(xiàn)節(jié)點(diǎn)監(jiān)控

備注:

prometheus的幾個(gè)SQL  建議上面不出圖的對著寫下
CPU使用率:
100 - (avg(irate(node_cpu_seconds_total{mode="idle"}[5m])) by (instance) * 100)
內(nèi)存使用率:
100 - (node_memory_MemFree_bytes+node_memory_Cached_bytes+node_memory_Buffers_bytes) / node_memory_MemTotal_bytes * 100
磁盤使用率:
100 - (node_filesystem_free_bytes{mountpoint="/",fstype=~"ext4|xfs"} / node_filesystem_size_bytes{mountpoint="/",fstype=~"ext4|xfs"} * 100)

上述就是基于prometheus11-k8s-node實(shí)現(xiàn)節(jié)點(diǎn)監(jiān)控的詳細(xì)內(nèi)容,詳細(xì)使用情況還需要大家自己動手實(shí)驗(yàn)使用過才能領(lǐng)會。如果想了解更多,歡迎關(guān)注億速云行業(yè)資訊頻道!

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI