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添加对应服务器

相关推荐
A_humble_scholar41 分钟前
Linux(十六)从页表到线程封装:深入理解 Linux 线程的共享、控制与封装
linux
海盗12341 小时前
.NET编码规范03-C#命名规范大全
linux·服务器·.net
WZF-Sang1 小时前
TCP和UDP协议
linux·服务器·网络·c++·学习·tcp/ip·udp
做个文艺程序员1 小时前
Linux第11篇:存储管理——磁盘分区、LVM 与文件系统
linux·运维·服务器
天空'之城1 小时前
Linux 系统编程 14:Reactor 反应堆模式
linux·开发语言·网络编程·reactor 反应堆模式
孫治AllenSun1 小时前
【Linux】服务器设置固定ip
linux·服务器·tcp/ip
法号:行颠1 小时前
《Linux内核源码全景解读:从上电到用户态》之 目录
linux
mounter6254 小时前
深入解析 RDMA 中的 Address Handler (AH) 缓存:AWS EFA 驱动的硬件演进与软件复用艺术
linux·kernel·rdma·hashtable·hash table·address handle
笑锝没心没肺11 小时前
fail2ban工具安装配置及使用
linux·运维·服务器
大卡片13 小时前
linux内核驱动开发
linux·运维·驱动开发