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:[email protected]: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:[email protected]: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 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章