当前位置: 首页 > article >正文

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 查看状态

http://www.kler.cn/news/324543.html

相关文章:

  • LeeCode打卡第三十一天
  • 基于springboot+vue学生宿舍管理系统设计与实现
  • 【Verilog学习日常】—牛客网刷题—Verilog企业真题—VL68
  • [240929] 12 款最佳免费开源隐写工具 | Llama 3.2: 开源、可定制模型,革新边缘人工智能和视觉体验
  • Windows 10 on ARM, version 22H2 (updated Sep 2024) ARM64 AArch64 中文版、英文版下载
  • Flask 实现文件下载
  • Vue3 项目环境变量配置(Vite)
  • 2024年7月大众点评全国小吃快餐前百名城市分析
  • U盘打开提示要格式化:深度解析、恢复策略与预防之道
  • CSS列表
  • 每天学习一个技术栈 ——【Celery】篇(2)
  • FTP 服务器 linux安装
  • 面试速通宝典——5
  • 解锁免费数据恢复工具的潜力,找回珍贵数据记忆
  • android设计模式的建造者模式,请举例
  • RabbitMQ的各类工作模式介绍
  • SOCKS5代理和HTTP代理哪个快?深度解析两者的速度差异
  • 支持云边协同的「物联网平台+边缘计算底座」
  • tcpdump捕获指定端口的网络流量并实时输出
  • OpenCV_自定义线性滤波(filter2D)应用详解
  • 护眼灯行业分水岭渐显,书客革命性创新成为企业扩容市场的第一动力
  • qt6 使用QPSQL
  • 【k8s】:DevOps 模式详解
  • 物联网系统中模拟温度传感器测温方案
  • 设计模式之享元(Flyweight)模式
  • 设计模式小记:构造器
  • QT九月28日
  • 阿里云函数计算 x NVIDIA 加速企业 AI 应用落地
  • 量化金融中的 AI 革命:LLMs 如何重新定义交易策略
  • .NET 开源的功能强大的人脸识别 API