Hallo, es geht um einen RPi Zero W mit Raspberry Pi OS Lite (buster). Darauf laufen Mosquitto, Grafana und InfluxDB und ein Python Script, statische IP-Adresse. Auf der SD-Karte nur bootcode.bin, Rest des OS auf USB-Stick.
Influx wurde installiert wie folgt ( abgeschrieben bei Installing InfluxDB & Grafana on Raspberry Pi – Simon Hearne) :
wget -qO- https://repos.influxdata.com/influxdb.key | sudo apt-key add -
source /etc/os-release
echo "deb https://repos.influxdata.com/debian $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/influxdb.list
sudo apt update && sudo apt install -y influxdb
sudo systemctl unmask influxdb.service
sudo systemctl start influxdb
sudo systemctl enable influxdb.service
Das Ganze läuft auch nach der Installation prima. Aber nach Neustarts des RPis - manchmal nach einem, dann wieder erst nach 10 -
startet InfluxDB nicht mehr, bleibt hängen mit
sudo systemctl list-units --type=service
.......
influxdb.service loaded activating start start InfluxDB is an open
sudo journalctl -u influxdb.service sagt:
-- Logs begin at Tue 2021-08-17 00:17:18 CEST, end at Tue 2021-08-17 12:03:10 CEST. --
Aug 17 00:17:48 RpiC systemd[1]: Starting InfluxDB is an open-source, distributed, time series database...
Aug 17 00:17:52 RpiC influxd-systemd-start.sh[441]: Merging with configuration at: /etc/influxdb/influxdb.conf
Aug 17 00:17:52 RpiC influxd-systemd-start.sh[441]: ts=2021-08-16T22:17:52.372932Z lvl=info msg="InfluxDB starting" log_id=0W0GX3y0000 version=1.8.9
Aug 17 00:17:52 RpiC influxd-systemd-start.sh[441]: ts=2021-08-16T22:17:52.379617Z lvl=info msg="Go runtime" log_id=0W0GX3y0000 version=go1.13.8 max
Aug 17 00:17:52 RpiC influxd-systemd-start.sh[441]: ts=2021-08-16T22:17:52.574192Z lvl=info msg="Using data dir" log_id=0W0GX3y0000 service=store pa
Aug 17 00:17:52 RpiC influxd-systemd-start.sh[441]: ts=2021-08-16T22:17:52.581821Z lvl=info msg="Compaction settings" log_id=0W0GX3y0000 service=sto
Aug 17 00:17:52 RpiC influxd-systemd-start.sh[441]: ts=2021-08-16T22:17:52.587260Z lvl=info msg="Open store (start)" log_id=0W0GX3y0000 service=stor
Aug 17 00:17:52 RpiC influxd-systemd-start.sh[441]: Merging with configuration at: /etc/influxdb/influxdb.conf
Aug 17 00:17:53 RpiC influxd-systemd-start.sh[441]: ts=2021-08-16T22:17:53.052464Z lvl=info msg="Reading file" log_id=0W0GX3y0000 engine=tsm1 servic
Aug 17 00:18:09 RpiC influxd-systemd-start.sh[441]: Failed to reach influxdb http endpoint at http://localhost:8086/health
Aug 17 00:18:09 RpiC systemd[1]: influxdb.service: Control process exited, code=exited, status=1/FAILURE
Aug 17 00:18:09 RpiC systemd[1]: influxdb.service: Failed with result 'exit-code'.
Aug 17 00:18:09 RpiC systemd[1]: Failed to start InfluxDB is an open-source, distributed, time series database.
Aug 17 00:18:10 RpiC systemd[1]: influxdb.service: Service RestartSec=100ms expired, scheduling restart.
Aug 17 00:18:10 RpiC systemd[1]: influxdb.service: Scheduled restart job, restart counter is at 1.
Aug 17 00:18:10 RpiC systemd[1]: Stopped InfluxDB is an open-source, distributed, time series database.
Aug 17 00:18:10 RpiC systemd[1]: Starting InfluxDB is an open-source, distributed, time series database...
Aug 17 10:39:13 RpiC influxd-systemd-start.sh[563]: Merging with configuration at: /etc/influxdb/influxdb.conf
Aug 17 10:39:14 RpiC influxd-systemd-start.sh[563]: ts=2021-08-17T08:39:14.298374Z lvl=info msg="InfluxDB starting" log_id=0W0p4_UW000 version=1.8.9
Aug 17 10:39:14 RpiC influxd-systemd-start.sh[563]: ts=2021-08-17T08:39:14.303342Z lvl=info msg="Go runtime" log_id=0W0p4_UW000 version=go1.13.8 max
Aug 17 10:39:14 RpiC influxd-systemd-start.sh[563]: ts=2021-08-17T08:39:14.487494Z lvl=info msg="Using data dir" log_id=0W0p4_UW000 service=store pa
Aug 17 10:39:14 RpiC influxd-systemd-start.sh[563]: ts=2021-08-17T08:39:14.493591Z lvl=info msg="Compaction settings" log_id=0W0p4_UW000 service=sto
Und das offensichtlich in einer Schleife.
Nach
sudo apt-get purge --auto-remove influxdb
sudo rm -rf /var/lib/influxdb
und Neuinstallationvon Influx wie oben geht es manchmal wieder (allerdings sind dann natürlich die Daten weg). In der Regel ist aber eine komplette Neuinstallation des OS erforderlich
Eine andere Fehlermeldung taucht auch mal auf:
pi@RpiC:~ $ sudo systemctl status influxdb.service
● influxdb.service - InfluxDB is an open-source, distributed, time series database
Loaded: loaded (/lib/systemd/system/influxdb.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Tue 2021-08-17 13:39:37 CEST; 36min ago
Docs: https://docs.influxdata.com/influxdb/
Aug 17 13:39:36 RpiC systemd[1]: influxdb.service: Service RestartSec=100ms expired, scheduling restart.
Aug 17 13:39:36 RpiC systemd[1]: influxdb.service: Scheduled restart job, restart counter is at 738.
Aug 17 13:39:37 RpiC systemd[1]: Stopped InfluxDB is an open-source, distributed, time series database.
Aug 17 13:39:37 RpiC systemd[1]: influxdb.service: Start request repeated too quickly.
Aug 17 13:39:37 RpiC systemd[1]: influxdb.service: Failed with result 'exit-code'.
Aug 17 13:39:37 RpiC systemd[1]: Failed to start InfluxDB is an open-source, distributed, time series database.
Das habe ich ca 20 mal durchgespielt, ist also reproduzierbar. Gleiches Verhalten, wenn das gesamte OS und alles andere auf der SD-Karte installiert ist.
Im Internet habe ich an mehreren Stellen gefunden, dass es Berechtigungsprobleme geben soll, die dort empfohlenen Befehle helfen aber auch nicht. Und wie gesagt, es funktioniert ja auch einige Male - die grundsätzlichen Berechtigungen müssen also mal gepasst haben.
Kennt jemand eine Lösung?