Grafana 入門篇1.1 — 在ubuntu 22.04 上安裝Grafana Enterprise

Ruei-Chi Huang
Kirin Blog | Kirin の IT Geek
5 min readNov 20, 2022

公司2020年拿到Datadog台灣總代理之後,今年(2022)又簽下Grafana簽約代理~

Grafana是一套非常優秀的SRE / DevOps 工具

在眾多SRE/DevOps的工具中,Grafana 一值佔有領先的地位,是系統效率、效能監控的好幫手,其直覺式可調控的儀表板,再輔以大量plugin彈性使用,可以充分滿足各種不同的應用場景,不論您的系統是架設在地端或是雲端,Grafana都可以整合,本篇會是一系列的應用教學開頭,由淺入深再到實際商轉整合的分享,希望對閱讀的朋友們能有幫助。

Grafana很容易上手,安裝只要四個步驟就完成

Lab 環境

CPU : AMD EPYC 7282
MB : DDR4 512G ECC
Disk : Micro MX500 1TB
OS : Ubuntu 22.04
Virtualization : PVE 7.2(Proxmox VE)

Step1. 安裝依賴元件

sudo su
apt-get install -y qemu-guest-agent
apt-get install -y apt-transport-https software-properties-common wget
wget -q -O /usr/share/keyrings/grafana.key https://apt.grafana.com/gpg.key

Step2. 把Grafana 源加入repository並重整apt-get

正式stable版 (商轉環境建議使用)

echo "deb [signed-by=/usr/share/keyrings/grafana.key] https://apt.grafana.com stable main" | sudo tee -a /etc/apt/sources.list.d/grafana.list

測試Demo版

echo "deb [signed-by=/usr/share/keyrings/grafana.key] https://apt.grafana.com beta main" | sudo tee -a /etc/apt/sources.list.d/grafana.list

更新apt-get的repository

apt-get update

Step3. 安裝Grafana Enterprise

apt-get install -y grafana-enterprise

Step4. 確認安裝狀況,並將Grafana enterprise 加到Ubuntu啟動程序中

啟動grafana server 並確認服務狀況

systemctl daemon-reload
systemctl start grafana-server
systemctl status grafana-server

查服務status 顯示為active 就表示安裝成功

把Grafna 服務加入 ubuntu 的開機啟動內

systemctl enable grafana-server.service

Setp5. 透過瀏覽器開啟Grafana Web Control

網址 : https:<<ur server ip>>:3000
Grafana 預設帳密 <<admin / admin>>
第一次登入後需要馬上變更admin密碼。

--

--

Ruei-Chi Huang
Kirin Blog | Kirin の IT Geek

I am Kirin., I was ShellFans AI Technology’s CTO. Our team specializes in IoT, Blockchain, Cloud and Ai. | https://www.shell.fans