Ubuntu安装grafana

需求背景:管理服务器,并在线预警,通知

需求目的:

及时获取服务器状态

技能要求:

1、ubuntu

2、grafana

3、prometheus

4、node

步骤:

一、grafana安装

1、准备系统环境,配置号网络

2、安装管理APT仓库

sudo apt-get install -y software-properties-common

2、添加Grafana的APT仓库

sudo add-apt-repository "deb https://packages.grafana.com/oss/deb stable main"

3、添加GRAFANA的GPG密钥

wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add -

更新APT包索引:apt update

安装Grafana:apt install grafana

4、启动服务,开机自动启动

sudo systemctl start grafana-server

sudo systemctl enable grafana-server

5、登录测试,默认密码admin admin

二、prometheus安装

  1. 首先,添加Prometheus官方的APT仓库:

echo "deb https://apt.prometheus.io/prometheus-2.30.3.linux-amd64/ ./" | sudo tee -a /etc/apt/sources.list.d/prometheus.list

  1. 导入Prometheus的APT仓库的GPG密钥:

wget https://apt.prometheus.io/prometheus-2.30.3.linux-amd64/release.key

sudo apt-key add release.key

  1. 更新APT包索引:

sudo apt-get update

  1. 安装Prometheus:

sudo apt-get install prometheus

  1. 启动Prometheus服务:

sudo systemctl start prometheus

  1. 使Prometheus在系统启动时自动启动:

sudo systemctl enable prometheus

  1. 检查Prometheus服务状态:

sudo systemctl status prometheus

三、node

上传

启动

nod已经启动了,安装prometheus的时候

四、配置prometheus

修改配置文件

五、配置grafana系统

1、Data sources

添加数据源

名称具体参数

以下prometheus服务一定需要搞清楚,其它可以默认

对应prometheus的服务端口

2、添加数据模版

导入ID8919

选择数据源

具体

有多少模版,访问Node Exporter Full | Grafana Labs

Grafana dashboards | Grafana Labs

喜欢哪个挑一个,鼠标点击

复制ID

六、检验

基本完成,后期需要增多管理的客户端服务器

1、客户端服务器启动node

2、配置prometheus添加对应服务器

相关推荐
FORCECON121 分钟前
力控SCADA工程升级:信创跨平台迁移方案,快速搭建安全自主的工业监控系统
linux·windows·自动化·信创·scada·监控组态软件
小义_25 分钟前
Linux 性能排查实战
linux·服务器·php
盐焗鹌鹑蛋1 小时前
【Linux】消息队列和信号量
linux
智者向内寻求力量2 小时前
【记录】ubuntu 24.04 安装在levnoval PC上之后,蓝牙设备找不到解决方法
linux·服务器·ubuntu
2301_810730102 小时前
K8s的Pod管理
linux·容器·kubernetes
DolphinDB智臾科技2 小时前
从数据到仪表盘——DolphinDB + Grafana 搭建工业物联网实时监控
物联网·grafana
川石课堂软件测试2 小时前
自动化测试常见的异常处理
python·jmeter·mysql·docker·容器·单元测试·grafana
tedcloud1232 小时前
diagram-design 怎么安装?用 AI 自动生成更专业的架构图、流程图
linux·运维·前端·人工智能·开源·流程图
huainingning2 小时前
Linux和Windows系統SCP命令传输文件
linux·运维·服务器
2401_862880822 小时前
Linux应用层开发 --- 多任务
linux·服务器·c语言