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

相关推荐
linmengmeng_13146 分钟前
【Centos】服务器硬盘扩容之新加硬盘扩容到现有路径下
linux·服务器·centos
边疆.8 分钟前
【Linux】版本控制器Git和调试器—gdb/cgdb的使用
linux·服务器·git·gdb调试·cgdb
陌路2038 分钟前
Linux22 进程与线程以及内核级线程
linux·开发语言
明天…ling42 分钟前
Linux+Apache+MySQL+PHP 架构下搭建 Discuz 社区论坛
linux·服务器·apache
Ghost Face...1 小时前
GRUB配置文件解析与启动流程详解
linux·运维·服务器
肩上风骋2 小时前
ubuntu系统使用ifconfig查询网络IP的时候,只能查到本地回环地址,无其他网络接口IP
网络·ubuntu·只能查到本地回环地址
星际工程师3 小时前
Windows10安装配置wsl+Ubuntu20.04环境
ubuntu
奔跑吧 android5 小时前
【Docker】【2.docker 安装 ubuntu 桌面版】
ubuntu·docker·容器
前端世界6 小时前
从零搭建多子网 DHCP 服务:CentOS 双网卡多作用域实战与原理解析
linux·运维·centos
tianyuanwo8 小时前
K8s Dashboard运维技巧全面经验总结
linux·运维·kubernetes