简体   繁体   English

如何在prometheus yml 配置文件中配置特定IP?

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

I would like to run Prometheus with a specific IP address.我想使用特定的 IP 地址运行 Prometheus。 By default, it is running on localhost.默认情况下,它在本地主机上运行。 I don't see any such option in the prometheus configuration我在prometheus 配置中没有看到任何这样的选项

您可以使用命令行选项来配置您的监听地址

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

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).如果您使用基于 Debian 的系统的软件包,您可以持续修改/etc/default/prometheus的命令行参数--web.listen-address (对于 /etc/default/prometheus-node-exporter 也是如此) .

You can change both the address to be bound (eg blank ( 0.0.0.0 ) or 127.0.0.1 or 192.168.xx.xx ) and the port number (eg 9090 ) here (eg :9090 or 127.0.0.1:9090 ).您可以在此处更改要绑定的地址(例如空白( 0.0.0.0 )或127.0.0.1192.168.xx.xx )和端口号(例如9090 )(例如:9090127.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.) (之后不要忘记systemctl restart prometheus prometheus-node-exporter 。)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM