洞察纵观鸿蒙next版本,如何凭借FinClip加强小程序的跨平台管理,确保企业在数字化转型中的高效运营和数据安全?
2292
2022-09-02
修改grafana的admin账号密码
方法一:进入pod内部进行访问
1.进入相关的pod
Plaintext |
2.修改用户admin密码:grafana-cli admin reset-admin-password
Plaintext |
方法二:直接修改
kubectl exec -it pod/grafana-978f4bb88-xfbv8 -nmonitoring -c grafana grafana-cli admin reset-admin-password Welc@me123
Plaintext |
方法三:通过class="data-table" data-id="t7a7e9d1-Hh9gkNHE" data-width="" style="outline: none; border-collapse: collapse; width: 100%;">
Plaintext Plaintext 2.使用sqlite3加载数据库文件 Plaintext 3.对密码进行还原(设置密码为admin/admin) Plaintext
版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。
发表评论
curl -X PUT -H "Content-Type: application/json" -d '{"oldPassword": "admin","newPassword": "Aa123456@123","confirmNew": "Aa123456@123"}' class="data-table" data-id="t7a7e9d1-d5Tga79A" data-width="" style="outline: none; border-collapse: collapse; width: 100%;">
1.1、通过master节点查找grafana所在的节点
[root@k8s-master tidb]# kubectl get pod -nmonitoring -owide
grafana-978f4bb88-xfbv8 2/2 Running 0 2d 10.244.2.82 k8s-node2 <none> <none>
1.2、在node2节点上查找文件
[root@k8s-node2 tidb]# find / -name "grafana.db"
/home/docker/images/overlay2/91c653a478a35838845a2c314e5837222390e10abebb0d9dda6d3a3776a18cfc/diff/var/lib/grafana/grafana.db
/home/docker/images/overlay2/ad79d41289140a452d6a1cf6134c87cf02e223fc2586b6fb4ed178e95197de5e/diff/var/lib/grafana/grafana.db
/home/docker/images/overlay2/3533bf5033accdd47191823259eaf2ab0435bc35e334a3051aab5e0f91ea7518/diff/var/lib/grafana/grafana.db
/home/k8s/kubelet/pods/2cb51d4d-ac72-47fe-a5fb-729e905c3939/volumes/kubernetes.io~empty-dir/grafana-storage/grafana.db
[root@k8s-node2 tidb]# ll /home/k8s/kubelet/pods/2cb51d4d-ac72-47fe-a5fb-729e905c3939/volumes/kubernetes.io~empty-dir/grafana-storage/grafana.db
-rw-r----- 1 nfsnobody nfsnobody 1900544 Aug 4 16:53 /home/k8s/kubelet/pods/2cb51d4d-ac72-47fe-a5fb-729e905c3939/volumes/kubernetes.io~empty-dir/grafana-storage/grafana.db
[root@k8s-node2 tidb]# sqlite3 /home/k8s/kubelet/pods/2cb51d4d-ac72-47fe-a5fb-729e905c3939/volumes/kubernetes.io~empty-dir/grafana-storage/grafana.db
1.3、查找所在的docker进程
[root@k8s-node2 tidb]# docker ps |grep grafana
645833ef5efb grafana/grafana "/run.sh" 2 days ago Up 2 days k8s_grafana_grafana-978f4bb88-xfbv8_monitoring_2cb51d4d-ac72-47fe-a5fb-729e905c3939_0
a846c6165742 grafana/grafana-image-renderer "dumb-init -- node b…" 2 days ago Up 2 days k8s_grafana-image-render_grafana-978f4bb88-xfbv8_monitoring_2cb51d4d-ac72-47fe-a5fb-729e905c3939_0
f79e5eb37904 k8s.gcr.io/pause:3.4.1 "/pause" 2 days ago Up 2 days k8s_POD_grafana-978f4bb88-xfbv8_monitoring_2cb51d4d-ac72-47fe-a5fb-729e905c3939_0
1.4、通过比较发现grafana所在的id是:2cb51d4d-ac72-47fe-a5fb-729e905c3939。所以可以确定grafna.db文件在
/home/k8s/kubelet/pods/2cb51d4d-ac72-47fe-a5fb-729e905c3939/volumes/kubernetes.io~empty-dir/grafana-storage/grafana.db
[root@k8s-node2 tidb]# sqlite3 /home/k8s/kubelet/pods/2cb51d4d-ac72-47fe-a5fb-729e905c3939/volumes/kubernetes.io~empty-dir/grafana-storage/grafana.db
SQLite version 3.7.17 2013-05-20 00:56:22
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite>
sqlite> select * from user;
1|0|admin|admin@localhost||7964ca22222f077bb226f19c415564ea5a5c2af4306942d90bea214046dd90518096c9c9dc4ce086fe249fa09fb1cd0b6640a|OOo71b544U|FauHeT5hUo||1|1|0||2022-08-02 09:03:26|2022-08-04 05:12:09|0|2022-08-04 05:27:00|0|0
2|0|chaosmesh|chaosmesh@123.com|chaosmesh|b22226d5734061e60c4cca730b68f9bbe9be037565e998c7fa1f475ba1fbe7451e8c718425ce7a55174ecaccab3de66a37401b4|dKngYxNZ7h|HF5kYgeQC8||1|0|0||2022-08-04 03:57:47|2022-08-04 03:59:15|0|2022-08-04 04:47:25|0|0
#.tables查看有那些表
.tables
#select查看表里面的内容
select * from user;
#使用update更新密码
update user set password = '59acf18b94d7eb0694c61e60ce44c110c7a683ac6a8f09580d626f90f4a242000746579358d77dd9e570e83fa24faa88a8a6', salt = 'F3FAxVm33R' where login = 'admin';
#修改完成后退出
.exit
暂时没有评论,来抢沙发吧~