How to configure a specific IP in prometheus yml configuration file?

╄→гoц情女王★ 提交于 2020-06-01 06:36:29

问题


I would like to run Prometheus with a specific IP address. By default, it is running on localhost. I don't see any such option in the prometheus configuration


回答1:


You can use the command line option for configuring your listen address

./prometheus --web.listen-address="0.0.0.0:9090"




回答2:


If you're using the packages for Debian-based systems, you can persistently modify the command line argument --web.listen-address in /etc/default/prometheus (and same for /etc/default/prometheus-node-exporter).

You can change both the address to be bound (e.g. blank (0.0.0.0) or 127.0.0.1 or 192.168.xx.xx) and the port number (e.g. 9090) here (e.g. :9090 or 127.0.0.1:9090).

It will look like:

# Set the command-line arguments to pass to the server.
ARGS="--web.listen-address=127.0.0.1:9090"

(Don't forget to systemctl restart prometheus prometheus-node-exporter afterward.)



来源:https://stackoverflow.com/questions/55672748/how-to-configure-a-specific-ip-in-prometheus-yml-configuration-file

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!