InfluxDB konnte nicht als Dienst gestartet werden

6454
Davide

Ich versuche, InfluxDB für den automatischen Start auf einem RHEL7-Rechner zu konfigurieren.

wenn ich mache:

sudo systemctl start influxdb 

Der Dienst schlägt fehl

[dadmin@localhost dashboard]$ sudo systemctl start influxdb [sudo] password for dadmin:  [dadmin@localhost dashboard]$ sudo systemctl status influxdb ● influxdb.service - InfluxDB is an open-source, distributed, time series database Loaded: loaded (/usr/lib/systemd/system/influxdb.service; enabled; vendor preset: disabled) Drop-In: /etc/systemd/system/influxdb.service.d └─override.conf Active: failed (Result: start-limit) since Thu 2017-05-11 13:16:29 CEST; 10s ago Docs: https://docs.influxdata.com/influxdb/ Process: 2562 ExecStart=/usr/bin/influxd -config /dashboard/influxdb.conf $ (code=exited, status=1/FAILURE) Main PID: 2562 (code=exited, status=1/FAILURE)  May 11 13:16:29 localhost.localdomain systemd[1]: influxdb.service: main process exited, code=exited, status=1/FAILURE May 11 13:16:29 localhost.localdomain systemd[1]: Unit influxdb.service entered failed state. May 11 13:16:29 localhost.localdomain systemd[1]: influxdb.service failed. May 11 13:16:29 localhost.localdomain systemd[1]: influxdb.service holdoff time over, scheduling restart. May 11 13:16:29 localhost.localdomain systemd[1]: start request repeated too quickly for influxdb.service May 11 13:16:29 localhost.localdomain systemd[1]: Failed to start InfluxDB is an open-source, distributed, time series database. May 11 13:16:29 localhost.localdomain systemd[1]: Unit influxdb.service entered failed state. May 11 13:16:29 localhost.localdomain systemd[1]: influxdb.service failed. 

Dies ist die Unit-Datei:

[dadmin@localhost dashboard]$ sudo systemctl cat influxdb.service [sudo] password for dadmin:  # /usr/lib/systemd/system/influxdb.service # If you modify this, please also make sure to edit init.sh  [Unit] Description=InfluxDB is an open-source, distributed, time series database Documentation=https://docs.influxdata.com/influxdb/ After=network-online.target  [Service] User=influxdb Group=influxdb LimitNOFILE=65536 EnvironmentFile=-/etc/default/influxdb ExecStart=/usr/bin/influxd -config /etc/influxdb/influxdb.conf $ KillMode=control-group Restart=on-failure  [Install] WantedBy=multi-user.target Alias=influxd.service  # /etc/systemd/system/influxdb.service.d/override.conf [Service] ExecStart= ExecStart=/usr/bin/influxd -config /dashboard/influxdb.conf $ 

Aber wenn ich direkt ausführen

/usr/bin/influxd -config /dashboard/influxdb.conf 

InfluxDB startet reibungslos.

Wo bin ich falsch

4
Siehe [diesen relevanten Thread] (https://community.influxdata.com/t/cant-start-systemd-service-for-influxdb-because-of-tls-certs/2539) in den Foren der InfluxData-Community. Justin W. Flory vor 6 Jahren 0

2 Antworten auf die Frage

2
Davide

Ich habe das Problem gefunden:

[dadmin@localhost dashboard]$ sudo tail /var/log/messages May 11 16:21:41 localhost influxd: [I] 2017-05-11T14:21:41Z Using data dir: /dashboard/influxdb/data service=store May 11 16:21:41 localhost influxd: run: open server: open tsdb store: open /dashboard/influxdb/data/_internal: permission denied May 11 16:21:41 localhost systemd: influxdb.service: main process exited, code=exited, status=1/FAILURE May 11 16:21:41 localhost systemd: Unit influxdb.service entered failed state. May 11 16:21:41 localhost systemd: influxdb.service failed. May 11 16:21:41 localhost systemd: influxdb.service holdoff time over, scheduling restart. May 11 16:21:41 localhost systemd: start request repeated too quickly for influxdb.service May 11 16:21:41 localhost systemd: Failed to start InfluxDB is an open-source, distributed, time series database. May 11 16:21:41 localhost systemd: Unit influxdb.service entered failed state. May 11 16:21:41 localhost systemd: influxdb.service failed. 

Als ich ausgeführt wurde

/usr/bin/influxd -config /dashboard/influxdb.conf 

Die Ordner wurden mit dadmin als Besitzer erstellt

Ich habe die Ordner entfernt und den Dienst neu gestartet. Jetzt funktioniert alles gut.

1
Frrank

Das Konfigurationsskript hat keine Berechtigungen.

Es verweist auf Verzeichnisse. Wenn Sie / opt / influxdb / influxd config> /etc/opt/influxdb/influxdb.conf ausführen, werden in der ausgegebenen Konfigurationsdatei alle Verzeichnisse unter ~ gespeichert. Wenn Sie root sind, wird ~ in / root übersetzt.

Wenn Sie / root nicht als InfluxDB-Datenverzeichnis verwenden möchten, gibt es einige Optionen.

Führen Sie / opt / influxdb / influxd config> /etc/opt/influxdb/influxdb.conf als Benutzer aus, den Sie influxd ausführen möchten. Die Konfigurationsdatei verwendet dann das Basisverzeichnis dieses Benutzers als Installationsverzeichnis. Bearbeiten Sie explizit /etc/opt/influxdb/influxdb.conf, um auf die Verzeichnisse zu verweisen, die Sie verwenden möchten.

Auch diese überprüfen Blog dies könnte es für Sie räumen