Wednesday, November 07, 2018

How To Fix "No Route to Host" in Prometheus node-exporter


   We installed and started Prometheus, however we can't get node-exporter metrics.  via /targets  , we find the error " ... no route to host "


    The error means Prometheus can't reach http endpoint  http://<ip address>:9100/metrics
     First test localhost if it is working on the node
Login Node:
#wget -O- localhost:9100/metrics
If you get output, it means endpoint is working fine. Otherwise check prometheus pod and logs

     Then test from the other node
Login other Node:
#wget -O- <ip address>:9100/metrics
If you can't get output, means there are some network or firewall issues
* check the your cloud provider and network security settings, make sure port 9100 is open
* check Node linux firewall service settings. In EL7, default port 9100 is not open
#firewall-cmd --add-port=9100/tcp --permanent
# systemctl restart firewalld

"no route to host"  error should be gone. More details Refer github doc


Unknown said...

Great, Thanks

amrita said...

Thanks alot. It worked for me.

Unknown said...

This was the solution for us