Change default port for prometheus

瀏覽次數:9,083 次
跳到第一則未讀訊息

imoh...@gmail.com

未讀,
2017年6月23日 下午3:21:202017/6/23
收件者:Prometheus Users
Hi,

I just downloaded prometheus version 1.7.1 and I want to run it but I have  small problem, there is another process which listens on port 9090 so I need to change the port where prometheus listens on to make it port 9091 for example but this seems does not work at all, here is my config file after stripping comments:

global:
  scrape_interval:     15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
  evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.
  external_labels:
      monitor: 'codelab-monitor'

rule_files:

scrape_configs:
  - job_name: 'prometheus'

    static_configs:
      - targets: ['localhost:9091']

This is the error message:
ERRO[0000] Error starting web server, exiting gracefully: listen tcp :9090: bind: address already in use  source="main.go:238"

I hope someone can help me, thanks a lot.


Ben Kochie

未讀,
2017年6月23日 下午3:32:532017/6/23
收件者:imoh...@gmail.com、Prometheus Users
The config is for what to collect, to change the running listening port, you have to set a command line flag.

Set  -web.listen-address ':9091'



--
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-users+unsubscribe@googlegroups.com.
To post to this group, send email to prometheus-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/0a76945b-2f6a-4ab6-8975-87f59815d68e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

imoh...@gmail.com

未讀,
2017年6月23日 下午3:37:062017/6/23
收件者:Prometheus Users、imoh...@gmail.com
I just found this option --web.listen-address="0.0.0.0:9091".

Can I make this change permanent using the configuration file? 

Ben Kochie

未讀,
2017年6月23日 下午4:13:112017/6/23
收件者:imoh...@gmail.com、Prometheus Users
No, the configuration file is for options that can change dynamically.  Changing the listen address is not possible on the fly.

On Jun 23, 2017 21:37, <imoh...@gmail.com> wrote:
I just found this option --web.listen-address="0.0.0.0:9091".

Can I make this change permanent using the configuration file? 

--
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-users+unsubscribe@googlegroups.com.
To post to this group, send email to prometheus-users@googlegroups.com.
回覆所有人
回覆作者
轉寄
0 則新訊息