Unable to change default port

524 views
Skip to first unread message

vikram....@sysdig.com

unread,
Apr 10, 2018, 12:36:31 PM4/10/18
to Prometheus Users
I am trying to launch prometheus in a docker container using the non standard port.  Instead of port 9090 I want to use 8000 (so like curl http://localhost:8000)  If I just issue the following command:

docker run -d -p 9090:9090  --label io.prometheus.scrape="true" --label io.prometheus.port="9090" -v ~/prometheus prom/prometheus

This works just fine.  But when I try to modify it slightly 

docker run -p 8000:8000  --label io.prometheus.scrape="true" --label io.prometheus.port="8000" -v /tmp//prometheus prom/prometheus --web.listen-address :8000

When I run that I get the following in the logs
level=info ts=2018-04-10T16:35:25.30164589Z caller=main.go:220 msg="Starting Prometheus" version="(version=2.2.1, branch=HEAD, revision=bc6058c81272a8d938c05e75607371284236aadc)"
level=info ts=2018-04-10T16:35:25.302269169Z caller=main.go:221 build_context="(go=go1.10, user=root@149e5b3f0829, date=20180314-14:15:45)"
level=info ts=2018-04-10T16:35:25.304020886Z caller=main.go:222 host_details="(Linux 4.4.0-116-generic #140-Ubuntu SMP Mon Feb 12 21:23:04 UTC 2018 x86_64 7acf6a464064 (none))"
level=info ts=2018-04-10T16:35:25.30441574Z caller=main.go:223 fd_limits="(soft=1048576, hard=1048576)"
level=info ts=2018-04-10T16:35:25.307421696Z caller=main.go:504 msg="Starting TSDB ..."
level=info ts=2018-04-10T16:35:25.312461159Z caller=web.go:382 component=web msg="Start listening for connections" address=:8000
level=info ts=2018-04-10T16:35:25.315650041Z caller=main.go:514 msg="TSDB started"
level=info ts=2018-04-10T16:35:25.316582637Z caller=main.go:588 msg="Loading configuration file" filename=prometheus.yml
level=info ts=2018-04-10T16:35:25.316977937Z caller=main.go:398 msg="Stopping scrape discovery manager..."
level=info ts=2018-04-10T16:35:25.317337112Z caller=main.go:411 msg="Stopping notify discovery manager..."
level=info ts=2018-04-10T16:35:25.317694278Z caller=main.go:432 msg="Stopping scrape manager..."
level=info ts=2018-04-10T16:35:25.318427112Z caller=main.go:407 msg="Notify discovery manager stopped"
level=info ts=2018-04-10T16:35:25.319013969Z caller=manager.go:460 component="rule manager" msg="Stopping rule manager..."
level=info ts=2018-04-10T16:35:25.319677828Z caller=manager.go:466 component="rule manager" msg="Rule manager stopped"
level=info ts=2018-04-10T16:35:25.320017569Z caller=notifier.go:512 component=notifier msg="Stopping notification manager..."
level=info ts=2018-04-10T16:35:25.321145565Z caller=main.go:573 msg="Notifier manager stopped"
level=info ts=2018-04-10T16:35:25.319083877Z caller=main.go:394 msg="Scrape discovery manager stopped"
level=info ts=2018-04-10T16:35:25.319100382Z caller=main.go:426 msg="Scrape manager stopped"
level=error ts=2018-04-10T16:35:25.322639195Z caller=main.go:582 err="Error loading config couldn't load configuration (--config.file=prometheus.yml): open prometheus.yml: no such file or directory"
level=info ts=2018-04-10T16:35:25.322994791Z caller=main.go:584 msg="See you next time!" 

I have added the --config.file=X but it still doesn't get it.  I am at a loss so I would appreciate any help 

Brian Brazil

unread,
Apr 10, 2018, 12:49:21 PM4/10/18
to vikram....@sysdig.com, Prometheus Users
On 10 April 2018 at 17:36, <vikram....@sysdig.com> wrote:
I am trying to launch prometheus in a docker container using the non standard port.  Instead of port 9090 I want to use 8000 (so like curl http://localhost:8000)  If I just issue the following command:

docker run -d -p 9090:9090  --label io.prometheus.scrape="true" --label io.prometheus.port="9090" -v ~/prometheus prom/prometheus

This works just fine.  But when I try to modify it slightly 

docker run -p 8000:8000  --label io.prometheus.scrape="true" --label io.prometheus.port="8000" -v /tmp//prometheus prom/prometheus --web.listen-address :8000
 
You probably want to include all the other flags that are needed in this setup:

Brian

 

When I run that I get the following in the logs
level=info ts=2018-04-10T16:35:25.30164589Z caller=main.go:220 msg="Starting Prometheus" version="(version=2.2.1, branch=HEAD, revision=bc6058c81272a8d938c05e75607371284236aadc)"
level=info ts=2018-04-10T16:35:25.302269169Z caller=main.go:221 build_context="(go=go1.10, user=root@149e5b3f0829, date=20180314-14:15:45)"
level=info ts=2018-04-10T16:35:25.304020886Z caller=main.go:222 host_details="(Linux 4.4.0-116-generic #140-Ubuntu SMP Mon Feb 12 21:23:04 UTC 2018 x86_64 7acf6a464064 (none))"
level=info ts=2018-04-10T16:35:25.30441574Z caller=main.go:223 fd_limits="(soft=1048576, hard=1048576)"
level=info ts=2018-04-10T16:35:25.307421696Z caller=main.go:504 msg="Starting TSDB ..."
level=info ts=2018-04-10T16:35:25.312461159Z caller=web.go:382 component=web msg="Start listening for connections" address=:8000
level=info ts=2018-04-10T16:35:25.315650041Z caller=main.go:514 msg="TSDB started"
level=info ts=2018-04-10T16:35:25.316582637Z caller=main.go:588 msg="Loading configuration file" filename=prometheus.yml
level=info ts=2018-04-10T16:35:25.316977937Z caller=main.go:398 msg="Stopping scrape discovery manager..."
level=info ts=2018-04-10T16:35:25.317337112Z caller=main.go:411 msg="Stopping notify discovery manager..."
level=info ts=2018-04-10T16:35:25.317694278Z caller=main.go:432 msg="Stopping scrape manager..."
level=info ts=2018-04-10T16:35:25.318427112Z caller=main.go:407 msg="Notify discovery manager stopped"
level=info ts=2018-04-10T16:35:25.319013969Z caller=manager.go:460 component="rule manager" msg="Stopping rule manager..."
level=info ts=2018-04-10T16:35:25.319677828Z caller=manager.go:466 component="rule manager" msg="Rule manager stopped"
level=info ts=2018-04-10T16:35:25.320017569Z caller=notifier.go:512 component=notifier msg="Stopping notification manager..."
level=info ts=2018-04-10T16:35:25.321145565Z caller=main.go:573 msg="Notifier manager stopped"
level=info ts=2018-04-10T16:35:25.319083877Z caller=main.go:394 msg="Scrape discovery manager stopped"
level=info ts=2018-04-10T16:35:25.319100382Z caller=main.go:426 msg="Scrape manager stopped"
level=error ts=2018-04-10T16:35:25.322639195Z caller=main.go:582 err="Error loading config couldn't load configuration (--config.file=prometheus.yml): open prometheus.yml: no such file or directory"
level=info ts=2018-04-10T16:35:25.322994791Z caller=main.go:584 msg="See you next time!" 

I have added the --config.file=X but it still doesn't get it.  I am at a loss so I would appreciate any help 

--
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/26069c7d-40ad-4579-bb24-42d87f7231b4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

pa.a...@gmail.com

unread,
Jun 15, 2018, 4:52:52 AM6/15/18
to Prometheus Users
Hi! - Did you find a work around? I have the same issue.
Thanks!
Aarthi
Reply all
Reply to author
Forward
0 new messages