Prometheus Grafana部署 搭建監(jiān)控系統(tǒng)四(基礎(chǔ)篇)

Grafana部署

  • 官網(wǎng)地址
https://grafana.com/grafana/download

rpm安裝

  • 安裝過(guò)程
[root@grafana ~]# wget https://dl.grafana.com/oss/release/grafana-6.5.0-1.x86_64.rpm
[root@grafana ~]# yum localinstall grafana-6.5.0-1.x86_64.rpm

配置文件位于/etc/grafana/grafana.ini,這里暫時(shí)保持默認(rèn)配置即可。

  • 設(shè)置開機(jī)自啟
[root@grafana ~]# systemctl enable grafana-server
[root@grafana ~]# systemctl start grafana-server

tar安裝

  • 安裝過(guò)程
[root@grafana ~]# wget https://dl.grafana.com/oss/release/grafana-6.5.0.linux-amd64.tar.gz
[root@grafana ~]# tar -zxvf grafana-6.5.0.linux-amd64.tar.gz -C /usr/local
[root@grafana ~]# ln -sv /usr/local/grafana-6.5.0.linux-amd64/ /usr/local/Prometheus_grafana
  • 后臺(tái)啟動(dòng)Grafana
[root@grafana ~]# nohup /usr/local/Prometheus_grafana/bin/grafana-server --config=/usr/local/Prometheus_grafana/conf/defaults.ini --homepath=/usr/local/Prometheus_grafana &
  • 配置systemd啟動(dòng)Grafana
[root@grafana ~]# vim /lib/systemd/system/grafana-server.service
[Unit]
Description=Grafana
After=network.target

[Service]
ExecStart=/usr/local/Prometheus_grafana/bin/grafana-server --config=/usr/local/Prometheus_grafana/conf/defaults.ini

[Install]
WantedBy=multi-user.target

# 重載配置并設(shè)置開機(jī)自啟
[root@grafana ~]# systemctl daemon-reload
[root@grafana ~]# systemctl start grafana-server
[root@grafana ~]#systemctl enable grafana-server 

訪問(wèn)圖形化界面

啟動(dòng)后,網(wǎng)頁(yè)中輸入配置機(jī)器的url,端口采用默認(rèn)的3000,http://localhost:3000(默認(rèn)帳號(hào)/密碼為admin/admin)

  • 登錄后,修改密碼
登錄.png
  • 添加數(shù)據(jù)源,選擇默認(rèn)Prometheus


    DataSource.png

    add data source.png

    Core.png
  • 導(dǎo)入Dashboards
# 如果想配置更方便的圖形化界面,與漢化版的儀表板,可直接從官網(wǎng)復(fù)制ID,進(jìn)行配置
# 官方 Dashboards
https://grafana.com/grafana/dashboards

# percona提供的json包
https://github.com/percona/grafana-dashboards
  • 配置步驟

點(diǎn)擊左側(cè)邊欄進(jìn)入Create->Import導(dǎo)入Dashboards ID,或者直接在官網(wǎng)下載好json包,->Upload .json file 進(jìn)行上傳
不同的監(jiān)控標(biāo)準(zhǔn)可以分成多個(gè)儀表板組。

import.png

json.png

Dashboard.png
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容