VictoriaMetrics vmalert 集成vmauth 错误问题原因
通过调试发现通过vmauth 默认的编码是gzip的,所以会有问题,通过仔细查看vmalert 的命令参数已经包含了
禁用gzip
说明:最新版本中作者已经修复了这个问题的bug,老版本可以参考此方法解决
参数
-http.disableResponseCompression
Disable compression of HTTP responses for saving CPU resources. By default compression is enabled to save network bandwidth
解决方法
禁用就可以了
完整docker-compose 文件
version: "3"
services:
vmstorage:
image: victoriametrics/vmstorage
ports:
- 8482:8482
- 8400:8482
- 8401:8482
volumes:
- ./strgdata:/storage
command:
- '--storageDataPath=/storage'
vmagent:
image: victoriametrics/vmagent
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml
ports:
- 8429:8429
command:
- -promscrape.config=/etc/prometheus/prometheus.yml
- -remoteWrite.basicAuth.username=dalong-insert-account-1
- -remoteWrite.basicAuth.password=dalong
- -remoteWrite.url=http://vmauth:8427
alertmanager:
image: prom/alertmanager:latest
volumes:
- "./alertmanager.yaml:/etc/alertmanager.yaml"
command:
- --config.file=/etc/alertmanager.yaml
- --storage.path=/tmp/alertmanager1
ports:
- 9093:9093
vmalert:
image: victoriametrics/vmalert
volumes:
- "./alert.rules:/etc/victoriametrics/alert.rules"
ports:
- 8880:8880
command:
- -rule=/etc/victoriametrics/alert.rules
- -datasource.url=http://vmauth:8427
- -datasource.basicAuth.password=dalong
- -datasource.basicAuth.username=dalong-select-account-1
- -notifier.url=http://alertmanager:9093
vmauth:
image: victoriametrics/vmauth
volumes:
- "./config.yaml:/etc/victoriametrics/config.yaml"
command:
- -auth.config=/etc/victoriametrics/config.yaml
- -http.disableResponseCompression
ports:
- 8427:8427
vminsert:
image: victoriametrics/vminsert
command:
- '--storageNode=vmstorage:8400'
ports:
- 8480:8480
vmselect:
image: victoriametrics/vmselect
command:
- '--storageNode=vmstorage:8401'
ports:
- 8481:8481
grafana:
image: grafana/grafana
ports:
- 3000:3000
说明
碰到问题还是仔细分析下,好好看看命令参数
参考资料
https://github.com/VictoriaMetrics/VictoriaMetrics/tree/cluster/app/vmauth
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· .NET10 - 预览版1新功能体验(一)
2019-05-22 rpmlint 方便的rpm spec 以及rpm 文件检查工具
2019-05-22 linux patch 简单学习
2019-05-22 rpm 简单 package 创建demo
2019-05-22 fio 文件系统io 性能测试安装使用
2019-05-22 保护 SSH 的三把锁
2019-05-22 redis 设置为只读模式