Prometheus|云原生|grafana的admin用户密码重置备忘记录

本文涉及的产品
EMR Serverless StarRocks,5000CU*H 48000GB*H
可观测监控 Prometheus 版,每月50GB免费额度
可观测可视化 Grafana 版,10个用户账号 1个月
简介: Prometheus|云原生|grafana的admin用户密码重置备忘记录

很久很久以前部署的一个Prometheus套装里的grafana密码给忘记了,回忆总是很痛苦,因此还是在这里简单的记录一下,下次就不需要满世界反翻找了。

一,

改库重置密码为admin

grafana密码存放在哪里的?

必须说明一下,grafana并不是不需要数据库的,只是它使用的是非常轻量的数据库sqlite

OK,如果不嫌麻烦,可以直接登录该数据库修改该库内的用户数据,直接修改密码,但此方法并不推荐,主要是门槛有点高,很多人并不太会数据库操作

大略流程是根据grafana的配置文件找到sqlite定义的数据库存放地址,使用sqlite 命令登录数据库,直接改表即可,但只能是重置密码为admin/admin

主要是密码在该库内是加密的:

[root@local]# sqlite3 /var/lib/grafana/grafana.db
#查看数据库中包含的表
.tables
#查看user表内容
select * from user;
#重置admin用户的密码为默认admin
update user set password = '59acf18b94d7eb0694c61e60ce44c110c7a683ac6a8f09580d626f90f4a242000746579358d77dd9e570e83fa24faa88a8a6', salt = 'F3FAxVm33R' where login = 'admin';
#退出sqlite3
.exit

此方式比较麻烦,还要使用admin/admin 再登录,在重设密码,不过胜在可靠,必定可以修改掉密码

二,

命令行重置密码

该方法基于 Grafana 4.1 以上,因此使用前需要看看grafana版本够不够哦

比较简单,一条命令即可:

grafana-cli admin reset-admin-password --homepath "/usr/share/grafana" newpass

这里说明一下,如果--homepath 不知道如何填写,whereis grafana 命令找一下就可以了

三,

api接口重置密码

该方法比较简单,推荐使用!!!!

curl -X PUT -H "Content-Type: application/json" -d '{
  "oldPassword": "admin",
  "newPassword": "newpass",
  "confirmNew": "newpass"
}' http://admin:admin@<your_grafana_host>:3000/api/user/password
目录
相关文章
|
25天前
|
Prometheus 监控 Cloud Native
基于Prometheus和Grafana的监控平台 - 环境搭建
基于Prometheus和Grafana的监控平台 - 环境搭建
|
1天前
|
JSON Prometheus 监控
Prometheus+Grafana 部署
Prometheus 和 Grafana 组成监控解决方案。Prometheus 是开源系统监控工具,Grafana 则用于数据可视化。要连接 Prometheus 数据源,登录 Grafana,点击设置,选择“连接”,添加新数据源,选择 Prometheus 类型,并填入 Prometheus 服务器的 HTTP 地址,如 `http://192.168.1.1:9090`,验证连接。之后,从 Grafana 官方仪表板库导入监控面板,如主机监控模板,以可视化系统状态。完成这些步骤后,便建立了有效的监控系统。
10 1
|
18天前
|
Prometheus 监控 Cloud Native
性能监控神器Prometheus、Grafana、ELK 在springboot中的运用
【6月更文挑战第27天】在 Spring Boot 应用中,监控和日志管理是确保系统稳定性和性能的重要手段。
36 4
|
1天前
|
JSON Prometheus 监控
Prometheus+Grafana主机运行数据
Prometheus 是一款开源监控工具,Node Exporter 是其官方插件,用于收集服务器硬件和系统指标。要安装 Node Exporter,下载最新二进制文件,解压并移动到目标位置。启动二进制文件或设置为服务。在 Prometheus 配置文件 `prometheus.yml` 中添加 Node Exporter 目标配置
8 0
|
1月前
|
Prometheus 监控 Cloud Native
【监控】Spring Boot+Prometheus+Grafana实现可视化监控
【监控】Spring Boot+Prometheus+Grafana实现可视化监控
49 6
|
1月前
|
Prometheus 监控 Cloud Native
SpringBoot2.x整合Prometheus+Grafana【附源码】
SpringBoot2.x整合Prometheus+Grafana【附源码】
27 1
|
2月前
|
存储 Prometheus 运维
【阿里云云原生专栏】云原生下的可观测性:阿里云 ARMS 与 Prometheus 集成实践
【5月更文挑战第25天】阿里云ARMS与Prometheus集成,为云原生环境的可观测性提供强大解决方案。通过集成,二者能提供全面精准的应用监控,统一管理及高效告警,助力运维人员及时应对异常。集成示例代码展示配置方式,但需注意数据准确性、监控规划等问题。这种集成将在云原生时代发挥关键作用,不断进化以优化用户体验,推动业务稳定发展。
153 0
|
2月前
|
Prometheus 监控 Kubernetes
Prometheus + Grafana安装
Prometheus + Grafana安装
|
2月前
|
Prometheus Cloud Native Java
微服务框架(二十三)Prometheus + Grafana 安装、配置及使用
此系列文章将会描述Java框架Spring Boot、服务治理框架Dubbo、应用容器引擎Docker,及使用Spring Boot集成Dubbo、Mybatis等开源框架,其中穿插着Spring Boot中日志切面等技术的实现,然后通过gitlab-CI以持续集成为Docker镜像。 本文为Prometheus + Grafana 安装、配置及使用 本系列文章中所使用的框架版本为Spring ...
|
2月前
|
Prometheus 监控 前端开发
prometheus|云原生|grafana-9.4.3版本的主题更改
prometheus|云原生|grafana-9.4.3版本的主题更改
175 0