Prometheus 问题整理

问题一 : context deadline exceeded

Get http://192.168.90.177:9100/metrics: context deadline exceeded

解决办法:有可能端口未开放,指定其他端口

[root@localhost ~]# ./node_exporter  --web.listen-address=":8080" & 

问题二:read: connection reset by peer

Get http://192.168.110.85:9100/metrics: 
read tcp 192.168.90.103:54328->192.168.110.85:9100
: read: connection reset by peer

未解决,不过修改端口是一个办法,在启exporter重置web.listen-address和web.telemetry-path会起作用,不过半小时又挂了,只能怀疑是网络问题了

问题三  无效的token,小尾巴

"INVALID" is not a valid start token

//查询curl http://192.168.110.85:9100/metrics

promhttp_metric_handler_requests_total{code="200"} 0
promhttp_metric_handler_requests_total{code="500"} 0
promhttp_metric_handler_requests_total{code="503"} 0

0

问题三同问题二,根据修改端口和metrics可以成功一会,过会失效,不知所云,如果是同一段的虚拟机就未出现此问题。问题二和问题三都是不同网段出现的。

问题四:监测postgres_exporter失败

解决办法:需要启动postgres_exporter的用户下加入DATA_SOURCE_NAME环境变量,

//root用户
[root@localhost node_exporter-1.0.0.linux-amd64]# vi /etc/profile
//加入
export DATA_SOURCE_NAME="postgresql://postgres:postgres@127.0.0.1:5432/postgres?sslmode=disable"
[root@localhost node_exporter-1.0.0.linux-amd64]# source /etc/profile

//非root用户
[postgres@localhost ~]$ cd $HOME
[postgres@localhost ~]$ vi .bash_profile 
//加入
export DATA_SOURCE_NAME="postgresql://postgres:postgres@127.0.0.1:5432/postgres?sslmode=disable"
[postgres@localhost ~]$ source .bash_profile 

//如果未生效,重启CMD
[postgres@localhost ~]$ echo $DATA_SOURCE_NAME
//启动postgres_exporter
[root@localhost postgres_exporter_v0.5.1_linux-amd64]# ./postgres_exporter 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值