您好,登錄后才能下訂單哦!
監(jiān)控容器服務(wù)器CPU、內(nèi)存、磁盤、I/O等信息,首先需要安裝node_exporter。node_exporter的作用是用于機器系統(tǒng)數(shù)據(jù)收集。
(1)下載node_exporter
https://prometheus.io/download/
shell> cd /Download/
shell> wget https://github.com/prometheus/node_exporter/releases/download/v0.18.1/node_exporter-0.18.1.linux-amd64.tar.gz
(2)解壓安裝
shell> tar -xvf node_exporter-0.18.1.linux-amd64.tar.gz
shell>cd node_exporter-0.18.1.linux-amd64
shell> mv node_exporter-0.18.1.linux-amd64 node_exporter
shell> chown -R prometheus.prometheus node_exporter
shell> systemctl restart node_exporter
shell>systemctl status node_exporter
shell>netstat -tunlp | grep node_exporter
(3)創(chuàng)建systemd服務(wù)
shell>cat > /etc/systemd/system/node_exporter.service << EOF
[Unit]
Description=node_exporter
After=network.target
[Service]
Type=simple
User=prometheus
ExecStart=/Download/node_exporter/node_exporter
Restart=on-failure
[Install]
WantedBy=multi-user.target
EOF
shell>systemctl daemon-reload
shell> systemctl start node_exporter #啟動node_exporter服務(wù)
shell> systemctl status node_exporter
(4)prometheus_server 中添加job
shell> vim /Download/prometheus/prometheus.yml
shell>systemctl restart prometheus #重啟prometheus服務(wù)
(5)查看prometheus控制臺是否獲取到了數(shù)據(jù)
瀏覽器->x.x.x.x:9090 ->status->targets 就可以看到所監(jiān)控的node
免責聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。