溫馨提示×

溫馨提示×

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

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

(2)node_exporter部署監(jiān)控容器主機

發(fā)布時間:2020-07-04 17:13:03 來源:網(wǎng)絡(luò) 閱讀:347 作者:TangYGao 欄目:系統(tǒng)運維

監(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

  • job_name: 'docker39'
    scrape_interval: 5s
    static_configs:
    • targets: ['10.10.204.39:9100']
      labels:

shell>systemctl restart prometheus #重啟prometheus服務(wù)

(5)查看prometheus控制臺是否獲取到了數(shù)據(jù)
瀏覽器->x.x.x.x:9090 ->status->targets 就可以看到所監(jiān)控的node

向AI問一下細節(jié)

免責聲明:本站發(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)容。

AI