• -------------------------------------------------------------
  • ====================================

【Grafana】开启匿名登录(anonymous login)注意的地方

建站指南 dewbay 2年前 (2022-07-04) 2293次浏览 已收录 0个评论 扫描二维码

最近一直在搞 grafana 相关的内容,尝试将嵌入的 grafana 放入到自己项目中,其中涉及到了登录相关的事情,于是,在 grafana 中开启 auth.anonymous 过程遇到的一些问题,再次记录一下

要为匿名用户设置登录,您需要在 defult.ini / grafana.ini 文件(Grafana \ conf)中进行这些小配置。

如果要隐藏登录页面,请执行此配置
[auth]
# Set to true to disable (hide) the login form, useful if you use OAuth
#disable_login_form = false
disable_login_form = true
更改 disable_login_form 到 true

启用匿名访问
[auth.anonymous]
# enable anonymous access
enabled = true

3.指定组织

# specify organization name that should be used for unauthenticated users
org_name = YOUR_ORG_NAME_HERE

我是在这儿遇到的坑, 因为自定义的组织名称没有在项目中定义, 所以开始匿名登录之后一直需要登录
最后通过查看日志 log 文件看到有这么一句话,
msg=”Anonymous access organization error: ‘My org.’: Organization not found”
原来是组织名称没有定义 ,
解决方案:
使用 admin 登录进去之后,修改了组织的名称, 保存,就 OK 了

重新启动 grafana,你应该能够看到 grafana(如果你没有看到 dasboard,只需将你的组织角色 Viewer 改为 Editor
# specify role for unauthenticated users
org_role = Editor

最后还要说一点,使用 Google 搜索,查到结果的优先级: 英文关键字 >> 中文关键字

参考链接:
How to setup Grafana so that no password is necessary to view dashboards


露水湾 , 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:【Grafana】开启匿名登录(anonymous login)注意的地方
喜欢 (0)
[]
分享 (0)
关于作者:
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址