mongodb_exporter icon indicating copy to clipboard operation
mongodb_exporter copied to clipboard

Unable to start mongodb exporter in 7.0.5 version of mongodb

Open mkmpvtltd1 opened this issue 11 months ago • 1 comments

 sudo systemctl status mongodb_exporter.service
● mongodb_exporter.service - MongoDB Exporter
     Loaded: loaded (/lib/systemd/system/mongodb_exporter.service; disabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Mon 2024-03-11 09:55:35 CET; 3min 2s ago
    Process: 129289 ExecStart=/usr/local/bin/mongodb_exporter (code=exited, status=203/EXEC)
   Main PID: 129289 (code=exited, status=203/EXEC)

[1]: mongodb_exporter.service: Scheduled restart job, restart counter is at 5.
[1]: Stopped MongoDB Exporter.
[1]: mongodb_exporter.service: Start request repeated too quickly.
[1]: mongodb_exporter.service: Failed with result 'exit-code'.
[1]: Failed to start MongoDB Exporter.

mkmpvtltd1 avatar Mar 11 '24 09:03 mkmpvtltd1

Ran into this as well. It's the group getting set in '/etc/systemd/system/mongodb_exporter.service' It's currently getting set to 'nogroup' by the RPM, but it should be 'mongodb_exporter'. Change it to 'mongodb_exporter' and it will start. I.e. here's what your .service file should look like:

[Unit]
Description=Prometheus MongoDB Exporter
Documentation=https://github.com/percona/mongodb_exporter
After=network.target

[Service]
Type=simple

User=mongodb_exporter
Group=mongodb_exporter

EnvironmentFile=-/etc/default/mongodb_exporter
ExecStart=/usr/bin/mongodb_exporter $OPTIONS
SyslogIdentifier=mongodb_exporter

Restart=always

[Install]
WantedBy=multi-user.target

Kellman3000 avatar Mar 14 '24 04:03 Kellman3000