问题一 : 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