这里Prometheus是通过如下方式启动的:
systemctl start prometheus.service
执行如下命令,查看Prometheus日志:
journalctl -u prometheus -f
错误:unable to parse authentication credentials,authorization failed
查看Prometheus配置文件prometheus.yml,如下:
remote_write:
- url: "http://bigdata111:8086/api/v1/prom/write?db=combeye&u=combeye&p=#Wtt2&Me"
如果不仔细研究,无法看出问题,后来发现,是因为密码中包含了url的特殊字符,例如这里#和&,需要使用编码代替,#对应编码%23,$对应编码%26,修改为如下:
remote_write:
- url: "http://bigdata111:8086/api/v1/prom/write?db=combeye&u=combeye&p=%23Wtt2%26Me"
成功!