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

news/2024/9/29 4:37:19/

一、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.ppmy.cn/news/1531772.html

相关文章

通过docker启动ElasticSearch后为ElasticSearch设置用户和密码

文章目录 0. 前言1. 没有设置用户名和密码的情况2. 为ElasticSearch设置用户名和密码2.1 进入 ElasticSearch 容器内部2.2 修改 ElasticSearch 的配置文件2.3 设置用户名和密码 3. 在 kibana 容器中指定访问 ElasticSearch 的用户名和密码4. 设置用户名和密码后的情况4.1 访问 …

计算机前沿技术-人工智能算法-大语言模型-最新研究进展-2024-09-25

计算机前沿技术-人工智能算法-大语言模型-最新研究进展-2024-09-25 1. PromSec: Prompt Optimization for Secure Generation of Functional Source Code with Large Language Models (LLMs) M Nazzal, I Khalil, A Khreishah, NH Phan - arXiv preprint arXiv:2409.12699, 2…

【RabbitMQ】应用问题

RabbitMQ 应用问题 1. 幂等性保障1.1 幂等性介绍1.2 解决⽅案全局唯⼀ID业务逻辑判断 2. 顺序性保障2.1 顺序性保障介绍2.2 顺序性保障⽅案 3. 消息积压问题3.1 原因分析3.2 解决⽅案 1. 幂等性保障 1.1 幂等性介绍 幂等性是数学和计算机科学中某些运算的性质, 它们可以被多次…

解决Windows远程桌面 “为安全考虑,已锁定该用户账户,原因是登录尝试或密码更改尝试过多,请稍后片刻再重试,或与系统管理员或技术支持联系“问题

根本原因就是当前主机被通过远程桌面输入了过多的错误密码,被系统锁定。这种情况多数是你的服务器远程桌面被人试图攻击了,不建议取消系统锁定策略。如果阿里云或者腾讯云主机,只需要在管理后台通过管理终端或者VNC登陆一次,锁定即…

软件测试学习路线图

软件测试工程师是专门从事软件、系统或产品测试和评估的技术专业人士,确保它们符合既定标准并无任何缺陷。通过精心设计和执行测试计划,软件测试工程师发现 Bug、故障和需要改进的领域,从而提高最终产品的可靠性和性能。 软件测试工程师在软…

多级侧边菜单(递归)

需要编写两个文件 aside-menu.vue 和 menu-item.vue menu-item.vue <script setup> defineOptions({name: MenuItem}) defineProps({menuList: Array}) </script><template><template v-for"menu of menuList"><!-- 如果当前有子菜单&a…

onload_tcpdump命令抓包报错Onload stack [7,] already has tcpdump process

最近碰到Onload 不支持同时运行多个 tcpdump 进程的报错&#xff0c;实际上使用了ps查询当时系统中并没有tcpdump相关进程存在。需要重启服务器本机使用onload加速的相关进程后才能使用onload_tcpdump正常抓包&#xff0c;很奇怪&#xff0c;之前确实没遇到这样的问题&#xff…

【Springboot入门- 事务】

基础理解 基本概念 事务&#xff1a;是一组原子性的数据库操作&#xff0c;要么全部成功&#xff0c;要么全部失败。ACID&#xff1a;事务需要满足原子性&#xff08;Atomicity&#xff09;、一致性&#xff08;Consistency&#xff09;、隔离性&#xff08;Isolation&#xf…