我正在尝试启用对Prometheus应用程序的基本身份验证。我按照Prometheus文档https://prometheus.io/docs/guides/basic-auth/.的步骤执行这些步骤。我已经按照文档配置了web-config.xml。
下面是web-config.xml的内容:
basic_auth_users:
管理员:"##$#$#$#$#$#$#$“
但是,当我验证配置时,它会失败,并引发以下错误:
root@Promethus server prometheus-2.17.0-rc.0.linux- not 64# ./promtool config /etc/prometheus/web-config.yml检查/etc/prometheus/web-config.yml失败:解析YAML文件/etc/prometheus/web-config.yml: yaml:解封送出错误:第1行:字段basic_auth_users未在类型config.plain中找到
有人能帮我吗?
问候拉吉夫
发布于 2022-07-08 08:59:08
这似乎是yaml语法错误。
如文档中所述,请遵循此格式(请注意第2行中的空格)
basic_auth_users:
admin: $2b$12$hNf2lSsxfm0.i4a.1kVpSOVyBCfIB51VRjgBUyv6kdnyTlgWj81Ay下面的
是web-config.xml的内容:
希望你是指web-config.yml
https://stackoverflow.com/questions/72902062
复制相似问题