systemctl start prometheus failed

880 views
Skip to first unread message

guo galen

unread,
Jan 29, 2021, 4:16:14 AM1/29/21
to Prometheus Users
hi, I can't start prometheus with systemctl ,  thanks for any help.

1. vim /etc/systemd/system/prometheus.service
[Unit]
Description=prometheus
Wants=network-online.target
After=network-online.target

[Service]
User=prometheus
Group=prometheus
Type=simple
Restart=on-failure
ExecStart=/opt/prometheus/prometheus \
          --config.file=/opt/prometheus/prometheus.yml \
          --web.listen-address="0.0.0.0:9696" \
          --storage.tsdb.path=/opt/prometheus/data \
          --web.console.templates=/opt/prometheus/consoles \
          --web.console.libraries=/opt/prometheus/console_libraries

[Install]
WantedBy=multi-user.target

systemctl daemon-reload
systemctl start prometheus 

2. systemctl status prometheu
prometheus.service - prometheus
   Loaded: loaded (/etc/systemd/system/prometheus.service; enabled; vendor preset: disabled)
   Active: failed (Result: start-limit) since Fri 2021-01-29 17:10:28 CST; 2min 59s ago
  Process: 25576 ExecStart=/opt/prometheus/prometheus --config.file=/opt/prometheus/prometheus.yml --web.listen-address="0.0.0.0:9696" --storage.tsdb.path=/opt/prometheus/data --web.console.templates=/opt/prometheus/consoles --web.console.libraries=/opt/prometheus/console_libraries (code=exited, status=2)
 Main PID: 25576 (code=exited, status=2)

Jan 29 17:10:28 zluat55 systemd[1]: Unit prometheus.service entered failed state.
Jan 29 17:10:28 zluat55 systemd[1]: prometheus.service failed.
Jan 29 17:10:28 zluat55 systemd[1]: prometheus.service holdoff time over, scheduling restart.
Jan 29 17:10:28 zluat55 systemd[1]: Stopped prometheus.
Jan 29 17:10:28 zluat55 systemd[1]: start request repeated too quickly for prometheus.service
Jan 29 17:10:28 zluat55 systemd[1]: Failed to start prometheus.
Jan 29 17:10:28 zluat55 systemd[1]: Unit prometheus.service entered failed state.
Jan 29 17:10:28 zluat55 systemd[1]: prometheus.service failed.

3. uname -a
     3.10.0-1127.el7.x86_64 #1 SMP Tue Mar 31 23:36:51 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

4. prometheus version is prometheus-2.24.1.linux-amd64.tar.gz

sayf eddine Hammemi

unread,
Jan 29, 2021, 4:22:02 AM1/29/21
to guo galen, Prometheus Users
Can you try running the command directly to see what is the issue ? /opt/prometheus/prometheus --config.file=/opt/prometheus/prometheus.yml --web.listen-address="0.0.0.0:9696" --storage.tsdb.path=/opt/prometheus/data --web.console.templates=/opt/prometheus/consoles --web.console.libraries=/opt/prometheus/console_libraries

--
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-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/c4883c67-eca5-4676-bf6e-398120550ffdn%40googlegroups.com.

Julius Volz

unread,
Jan 29, 2021, 4:24:31 AM1/29/21
to guo galen, Prometheus Users
"systemctl -u prometheus" should give you the full log output that hopefully shows why the startup failed.

On Fri, Jan 29, 2021 at 10:16 AM guo galen <galen....@gmail.com> wrote:
--
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-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/c4883c67-eca5-4676-bf6e-398120550ffdn%40googlegroups.com.


--
Julius Volz
PromLabs - promlabs.com

Антон Зубков

unread,
Jan 29, 2021, 5:31:59 AM1/29/21
to Prometheus Users
systemctl doesn't have -u flag, but journalctl have it :)

пятница, 29 января 2021 г. в 11:24:31 UTC+2, juliu...@promlabs.com:

Julius Volz

unread,
Jan 29, 2021, 5:46:25 AM1/29/21
to Антон Зубков, Prometheus Users
Ah yes, that's what I meant of course :) "journalctl -u prometheus"

guo galen

unread,
Jan 30, 2021, 11:24:10 PM1/30/21
to Prometheus Users
journalctl -f  show invalid port:
parse external URL "": parse "http://zluat55:9696\"/": invalid port ":9696\"" after host

guo galen

unread,
Jan 31, 2021, 12:35:29 AM1/31/21
to Prometheus Users
it's ok after remove  --web.listen-address="0.0.0.0:9696" \
Reply all
Reply to author
Forward
0 new messages