[kubernetes]-prometheus开启动态加载
导语:使用命令curl -X POST http://localhost:9090/-/reload 或者kill -HUP pid 重新加载配置文件,会报错Lifecycle API is not enabled。经常修改配置,刚刚重启完,target都是unhealthy的。开启Lifecycle API修改/etc/systemd/system/prometheus.service添加--w
·
导语:使用命令curl -X POST http://localhost:9090/-/reload
或者kill -HUP pid
重新加载配置文件,会报错Lifecycle API is not enabled。经常修改配置,刚刚重启完,target都是unhealthy的。
开启Lifecycle API
修改/etc/systemd/system/prometheus.service
添加--web.enable-lifecycle
启用选项
systemctl daemon-reload
systemctl restart prometheus
这下就不会报错了
kill -HUP 我没看到进程id变化 以为没有重载成功 后面查看日志发现加载成功了
更多推荐
所有评论(0)