溫馨提示×

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

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

Prometheus和NodeExporter安裝監(jiān)控?cái)?shù)據(jù)的方法

發(fā)布時(shí)間:2022-07-16 09:38:04 來源:億速云 閱讀:110 作者:iii 欄目:開發(fā)技術(shù)

這篇文章主要介紹了Prometheus和NodeExporter安裝監(jiān)控?cái)?shù)據(jù)的方法的相關(guān)知識(shí),內(nèi)容詳細(xì)易懂,操作簡(jiǎn)單快捷,具有一定借鑒價(jià)值,相信大家閱讀完這篇Prometheus和NodeExporter安裝監(jiān)控?cái)?shù)據(jù)的方法文章都會(huì)有所收獲,下面我們一起來看看吧。

在mac下載安裝prometheus

  • 在https://prometheus.io/download/下載prometheus放到自定義的位置。

  • 解壓壓縮包

  • 創(chuàng)建data文件夾mkdir -p data

mac下安裝Node Exporter

(NodeExporter是Prometheus提供的一個(gè)可以采集到主機(jī)信息的應(yīng)用程序,它能采集到機(jī)器的 CPU、內(nèi)存、磁盤等信息)

cd到目標(biāo)目錄,然后用命令下載二進(jìn)制包

curl -OL https://github.com/prometheus/node_exporter/releases/download/v1.3.1/node_exporter-1.3.1.darwin-amd64.tar.gz

解壓這個(gè)二進(jìn)制包

tar -xzf node_exporter-1.3.1.darwin-amd64.tar.gz

進(jìn)入&運(yùn)行node exporter

cd node_exporter-1.3.1.darwin-amd64
cd ..
cp node_exporter-1.3.1.darwin-amd64/node_exporter /usr/local/bin/node_exporter

運(yùn)行

cd ...
cd /usr/local/bin
./node_exporter

訪問http://localhost:9100/看到

Prometheus和NodeExporter安裝監(jiān)控?cái)?shù)據(jù)的方法

點(diǎn)擊http://localhost:9100/metrics進(jìn)去可以看到

# HELP node_cpu Seconds the cpus spent in each mode.
# TYPE node_cpu counter
node_cpu{cpu="cpu0",mode="idle"} 362812.7890625
# HELP node_load1 1m load average.
# TYPE node_load1 gauge
node_load1 3.0703125

數(shù)據(jù)說明

  • HELP 解釋當(dāng)前指標(biāo)的含義

  • TYPE 說明當(dāng)前指標(biāo)的數(shù)據(jù)類型

  • node_cpu的注釋表明當(dāng)前指標(biāo)是cpu0上idle進(jìn)程占用CPU的總時(shí)間

  • CPU占用時(shí)間是一個(gè)只增不減的度量指標(biāo),從類型中也可以看出node_cpu的數(shù)據(jù)類型是計(jì)數(shù)器(counter)

  • node_load1 該指標(biāo)反映了當(dāng)前主機(jī)在最近一分鐘以內(nèi)的負(fù)載情況 指標(biāo)類型為儀表盤(gauge)

關(guān)于“Prometheus和NodeExporter安裝監(jiān)控?cái)?shù)據(jù)的方法”這篇文章的內(nèi)容就介紹到這里,感謝各位的閱讀!相信大家對(duì)“Prometheus和NodeExporter安裝監(jiān)控?cái)?shù)據(jù)的方法”知識(shí)都有一定的了解,大家如果還想學(xué)習(xí)更多知識(shí),歡迎關(guān)注億速云行業(yè)資訊頻道。

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

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

AI