centos安裝普羅米修斯和Grafana

不忘初心2021發表於2024-03-06

安裝普羅米修斯(以下地址無法開啟,請聯絡1065588611@qq.com,索要最新ip地址)

mkdir prometheus
cd prometheus
wget  http://180.164.29.221:2024/upload/2024/02/2gu5npn0ocif8rdb8ioqbihq8o.gz
mv 2gu5npn0ocif8rdb8ioqbihq8o.gz  prometheus.tar.gz
tar -zxvf prometheus.tar.gz
cp -R prometheus-2.45.3.linux-amd64 /usr/local/prometheus

  

vim /usr/lib/systemd/system/prometheus.service

[Unit]
Description=Prometheus
Documentation=https://prometheus.io/
After=network.target

[Service]
Type=simple
User=root
WorkingDirectory=/usr/local/prometheus
ExecStart=/usr/local/prometheus/prometheus 
Restart=on-failure

[Install]
WantedBy=multi-user.target

  

啟動服務和設定開機自動啟動
systemctl daemon-reload
systemctl enable prometheus.service
systemctl start prometheus.service

  頁面輸入http://47.100.61.43:9090/targets?search=,效果圖如下所示

安裝 Grafana

mkdir Grafana
cd Grafana
wget http://180.164.29.221:2024/upload/2024/02/6teeejrvjog95ooba760ftdaeu.rpm

mv 6teeejrvjog95ooba760ftdaeu.rpm  grafana.rpm

yum install -y grafana.rpm


systemctl enable grafana-server
systemctl start grafana-server

啟動後,可以使用 systemctl status grafana-server 命令檢視狀態,出現下圖介面,表示啟動成功


在瀏覽器訪問地址:http://47.100.61.43:3000/,出現下圖介面,說明 Grafana 已經安裝成功了

  

預設賬號和密碼是admin/admin

開啟後的頁面

安裝 node_exporter

mkdir node_exporter
cd node_exporter
wget  http://180.164.29.221:2024/upload/2024/03/vndi0t81nehffok4fp0uaj6924.gz
mv  vndi0t81nehffok4fp0uaj6924.gz  node_exporter-1.6.1.linux-amd64.tar.gz
tar -zxvf node_exporter-1.6.1.linux-amd64.tar.gz
cp -R node_exporter-1.6.1.linux-amd64 /usr/local/node_exporter

  vim /usr/lib/systemd/system/node_exporter.service

[Unit]
Description=node_exporter
After=network.target

[Service]
Type=simple
User=root
ExecStart=/usr/local/node_exporter/node_exporter
Restart=on-failure

[Install]
WantedBy=multi-user.target

  

設定開機自動啟動

systemctl daemon-reload
systemctl enable node_exporter.service
systemctl start node_exporter.service

開啟頁面
http://47.100.61.43:9100/

  

相關文章