1

I am trying to run Prometheus on my Ubuntu Linux VM on a Mac M1 (if those details are necessary).

OS: Ubuntu 23.10
Prometheus: 2.51.2

I make the config files, and as I run the following lines,

sudo systemctl daemon-reload
sudo systemctl start prometheus
sudo systemctl status prometheus

I am met with this error:

prometheus.service - Prometheus
     Loaded: loaded (/etc/systemd/system/prometheus.service; enabled; preset: enabled)
     Active: failed (Result: exit-code) since Tue 2024-04-23 15:52:29 UTC; 20s ago
   Duration: 3ms
    Process: 4410 ExecStart=/usr/local/bin/prometheus --config.file /etc/prometheus/prometheus.yml --storage.tsdb.path /var/lib/prometheus/ --web.console.templates=/etc/prometheus/consoles --web.console.libraries=/etc/prometheus/console_libraries (code=exited, status=203/EXEC)
   Main PID: 4410 (code=exited, status=203/EXEC)
        CPU: 1ms

Apr 23 15:52:29 uutobobuntu systemd[1]: Started prometheus.service - Prometheus.
Apr 23 15:52:29 uutobobuntu (ometheus)[4410]: prometheus.service: Failed to execute /usr/local/bin/prometheus: Exec format error
Apr 23 15:52:29 uutobobuntu (ometheus)[4410]: prometheus.service: Failed at step EXEC spawning /usr/local/bin/prometheus: Exec format error
Apr 23 15:52:29 uutobobuntu systemd[1]: prometheus.service: Main process exited, code=exited, status=203/EXEC
Apr 23 15:52:29 uutobobuntu systemd[1]: prometheus.service: Failed with result 'exit-code'.

This is the systemd service file:

[Unit]
Description=Prometheus
Wants=network-online.target
After=network-online.target

[Service]
User=prometheus
Group=prometheus
Type=simple
ExecStart=/usr/local/bin/prometheus \
    --config.file /etc/prometheus/prometheus.yml \
    --storage.tsdb.path /var/lib/prometheus/ \
    --web.console.templates=/etc/prometheus/consoles \
    --web.console.libraries=/etc/prometheus/console_libraries

[Install]
WantedBy=multi-user.target

(I have also tried with WantedBy=default.target)

I have tried with multiple VMs, but I keep running into the same issues. Every time I run the three lines, it immediately errors, and I am yet to find success.

2 Answers 2

1

Exec format error means you're having CPU architecture mismatch. For Mac M1 you need to download arm64 Prometheus binary.

1
  • Ah, I'm not used to using it, so I thought to go with Linux AMD. Still learnning, and thank you!
    – drew
    Apr 24 at 11:01
0

Have you verified the configuration file is valid? See How to check your prometheus.yml is valid

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.