리눅스

[prometheus] dial tcp 127.0.0.1:9100: connect: connection refused

나뭇빛자루 2021. 7. 27. 16:21
반응형

문제 해결

 

9100 로 exporter 노드를 만들어서

프로메테우스  prometheus.yml 에 job_name에 써줬음 

 - job_name: 'node-exporter'
    scrape_interval: 5s
    static_configs:
      - targets: ['localhost:9100']

이런식으로 작성했는데 아래와 같은 애러가 나옴

 

 Get "http://localhost:9100/metrics": dial tcp 127.0.0.1:9100: connect: connection refused

 

확인을 위해 exporter  접속해봄

curl http://localhost:9100/metrics

잘뜬다.

 

생각해보니 안될 이유가 없는데

- targets: ['localhost:9100']  부분을 실제 사용 IP 주소로 변경함 

- targets: ['xxx.xxx.xxx.xxx:9100']

 

원인 해결 

반응형