Apache APISIX学习(2):安装Grafana、prometheus

一、Grafana安装

1、介绍

Grafana 是一个监控仪表系统,它是由 Grafana Labs 公司开源的的一个系统监测 (System Monitoring) 工具。它可以大大帮助你简化监控的复杂度,你只需要提供你需要监控的数据,它就可以帮你生成各种可视化仪表。同时它还有报警功能,可以在系统出现问题时通知你。

下载命令:

复制代码
wget https://dl.grafana.com/enterprise/release/grafana-enterprise-10.4.1-1.x86_64.rpm -P /tmp

进行安装:

复制代码
yum install -y /tmp/grafana-enterprise-10.4.1-1.x86_64.rpm

设置中文:

复制代码
sed -i "s|^default_language =.*|default_language = zh-Hans|" /usr/share/grafana/conf/defaults.ini

2、启动

启动:

复制代码
systemctl start grafana-server

浏览器访问 http://服务器地址:3000 登录UI页面。用户名和密码都是admin

第一次登录时要更改密码。这里把密码重置成admin666

主界面

3、Grafana命令

  • systemctl start grafana-server 启动
  • systemctl restart grafana-server 重启
  • systemctl stop grafana-server 停止
  • systemctl enable grafana-server 开机启动
  • systemctl disable grafana-server 禁止开机启动
  • systemctl status grafana-server 查看状态

二、安装prometheus

1、介绍

prometheus是由谷歌研发的一款开源的监控软件,它通过安装在远程机器上的exporter,通过HTTP协议从远程的机器收集数据并存储在本地的时序数据库上同时Prometheus后端用 golang语言开发,前端是 Grafana。

下载:

复制代码
mkdir -p /opt/module
wget https://github.com/prometheus/prometheus/releases/download/v2.51.0/prometheus-2.51.0.linux-amd64.tar.gz -P /tmp

解压安装:

复制代码
tar -zxvf /tmp/prometheus-2.51.0.linux-amd64.tar.gz -C /opt/module

2、配置服务启动

创建配置文件

复制代码
vim /usr/lib/systemd/system/prometheus.service

内容如下:

复制代码
[Unit]
Description=Prometheus
Documentation=https://prometheus.io/
After=network.target

[Service]
Type=simple
ExecStart=/opt/module/prometheus-2.51.0.linux-amd64/prometheus --config.file=/opt/module/prometheus-2.51.0.linux-amd64/prometheus.yml --web.listen-address=0.0.0.0:9090
ExecReload=/bin/kill -HUP $MAINPID
KillMode=process
Restart=on-failure

[Install]
WantedBy=multi-user.target

启动:

复制代码
systemctl start prometheus

浏览器访问 http://服务器地址:9090 进入UI页面。

3、prometheus启停命令

  • systemctl start prometheus 启动
  • systemctl restart prometheus 重启
  • systemctl stop prometheus 停止
  • systemctl enable prometheus 设置开机启动
  • systemctl disable prometheus 禁止开机启动
  • systemctl status prometheus 查看状态
相关推荐
1024小神15 分钟前
SVG标签中path路径参数学习
学习
浅念-30 分钟前
C++入门(2)
开发语言·c++·经验分享·笔记·学习
ZH154558913131 分钟前
Flutter for OpenHarmony Python学习助手实战:面向对象编程实战的实现
python·学习·flutter
简佐义的博客1 小时前
生信入门进阶指南:学习顶级实验室多组学整合方案,构建肾脏细胞空间分子图谱
人工智能·学习
近津薪荼1 小时前
dfs专题4——二叉树的深搜(验证二叉搜索树)
c++·学习·算法·深度优先
rannn_1111 小时前
【苍穹外卖|Day4】套餐页面开发(新增套餐、分页查询、删除套餐、修改套餐、起售停售)
java·spring boot·后端·学习
张人玉1 小时前
VisionPro 定位与卡尺测量学习笔记
笔记·学习·计算机视觉·vsionprp
觉醒大王2 小时前
强女思维:着急,是贪欲外显的相。
java·论文阅读·笔记·深度学习·学习·自然语言处理·学习方法
YCY^v^3 小时前
JeecgBoot 项目运行指南
java·学习
云小逸3 小时前
【nmap源码解析】Nmap OS识别核心模块深度解析:osscan2.cc源码剖析(1)
开发语言·网络·学习·nmap