Installation InfluxDB2 funktioniert nicht

Topics about the Software of Revolution Pi
Post Reply
REVPI-WHS
Posts: 14
Joined: 21 Nov 2024, 18:07

Installation InfluxDB2 funktioniert nicht

Post by REVPI-WHS »

Hallo Zusammen,
in meinem letzten Post hattet Ihr mir folgende Anleitung für meinen Revolution Pi Module 4S Rev 1.0 (bookworm) mitgegeben: https://revolutionpi.com/documentation/ ... h-grafana/
Aber egal was ich mache, bei Eingabe von:

echo 'deb [signed-by=/etc/apt/trusted.gpg.d/influxdata-archive_compat.gpg] https://repos.influxdata.com/debian stable main' | sudo tee /etc/apt/sources.list.d/influxdata.list
cat influxdata-archive_compat.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/influxdata-archive_compat.gpg > /dev/null
sudo apt update && sudo apt install -y influxdb2

bekomme ich Fehlermeldungen:
-----------------------------
cat: influxdata-archive_compat.key: No such file or directory
-bash: gpg: command not found
Hit:1 http://deb.debian.org/debian bookworm-updates InRelease
Hit:2 http://security.debian.org/debian-security bookworm-security InRelease
Hit:3 http://packages.revolutionpi.de bookworm InRelease
Hit:4 http://packages.revolutionpi.de bookworm-backports InRelease
Hit:5 https://deb.debian.org/debian bookworm InRelease
Get:6 https://repos.influxdata.com/debian stable InRelease [6,907 B]
Hit:7 http://archive.raspberrypi.org/debian bookworm InRelease
Err:6 https://repos.influxdata.com/debian stable InRelease
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY D8FF8 E1F7DF8B07E
Reading package lists... Done
W: GPG error: https://repos.influxdata.com/debian stable InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY D8FF8E1F7DF8B07E
E: The repository 'https://repos.influxdata.com/debian stable InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
------------------------------------------------------------------------------------

Über einen Tipp würde ich mich sehr freuen, im Netz finde ich leider bezogen auf den RevPi keine Hilfe.
Vielen Dank and Grüße
Andreas
User avatar
dirk
KUNBUS
Posts: 2242
Joined: 15 Dec 2016, 13:19

Re: Installation InfluxDB2 funktioniert nicht

Post by dirk »

Hi Andras, da hat sich wohl ein Fehler eingeschichen - also zuerst mal fehlt das Paket "gpg" - das kannst du so installieren

Code: Select all

sudo apt install gpg
Dann kommt bei mir aber noch dieser Fehler

Code: Select all

pi@RevPi94369:~$ echo 'deb [signed-by=/etc/apt/trusted.gpg.d/influxdata-archive_compat.gpg] https://repos.influxdata.com/debian stable main' | sudo tee /etc/apt/sources.list.d/influxdata.list

cat influxdata-archive_compat.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/influxdata-archive_compat.gpg > /dev/null 
sudo apt update && sudo apt install -y influxdb2
deb [signed-by=/etc/apt/trusted.gpg.d/influxdata-archive_compat.gpg] https://repos.influxdata.com/debian stable main
cat: influxdata-archive_compat.key: No such file or directory
gpg: no valid OpenPGP data found.
Hit:1 http://packages.revolutionpi.de bookworm InRelease
Hit:2 http://packages.revolutionpi.de bookworm-backports InRelease                                                                                                                     
Hit:3 http://deb.debian.org/debian bookworm-updates InRelease                                                                                                                          
Hit:4 http://security.debian.org/debian-security bookworm-security InRelease                                                                                                           
Hit:5 http://archive.raspberrypi.org/debian bookworm InRelease                                                                                  
Hit:6 https://deb.debian.org/debian bookworm InRelease                                                                   
Get:7 https://repos.influxdata.com/debian stable InRelease [6,907 B]                               
Err:7 https://repos.influxdata.com/debian stable InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY D8FF8E1F7DF8B07E
Reading package lists... Done
W: GPG error: https://repos.influxdata.com/debian stable InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY D8FF8E1F7DF8B07E
E: The repository 'https://repos.influxdata.com/debian stable InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
pi@RevPi94369:~$ 
Wahrscheinlich hat sich hier eine URL geändert
REVPI-WHS
Posts: 14
Joined: 21 Nov 2024, 18:07

Re: Installation InfluxDB2 funktioniert nicht

Post by REVPI-WHS »

Hi Dirk,

ich habe es zum Laufen gebracht. Tatsächlich sind in der Anlage (https://revolutionpi.com/documentation/ ... h-grafana/) zwei Angaben, die so nicht mehr funktionieren können.
a) cat influxdata-archive_compat.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/influxdata-archive_compat.gpg > /dev/null
sudo apt update && sudo apt install -y influxdb2

Meine Lösung war:
Notwendige Tools aufspielen:
1. sudo apt-get update
2. sudo apt-get install wget
3. sudo apt-get install gpg-agent
4. sudo apt-get update
5. sudo apt-get install curl
Alten Schlüssel entfernen:
sudo rm /etc/apt/trusted.gpg.d/influxdata-archive_compat.gpg
sudo rm /etc/apt/trusted.gpg.d/influxdb.gpg

Dann Import der Schlüssel direkt mit gpg:

curl -s https://repos.influxdata.com/influxdata ... compat.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/influxdata-archive_compat.gpg

Paketliste aktualisieren:
sudo apt-get update

Installiere InfluxDB2:
sudo apt-get install influxdb2

Check, ob alles geklappt hat mit:
influxd version

Starten des InfluxDB-Dienstes:
sudo systemctl start influxdb

Überprüfen, ob der Dienst läuft:
sudo systemctl status influxdb

Das klappte sehr gut.
-----------------------------------------------
Das Hauptproblem war, dass die Schlüsseldateien nicht korrekt hinzugefügt wurden und die alten Methoden zur Schlüsselverwaltung (apt-key) veraltet sind. Durch das direkte Importieren des Schlüssels und die Verwendung des /etc/apt/trusted.gpg.d/-Verzeichnisses wurde das Problem gelöst. So konnten sichergestellt werden, dass der richtige Schlüssel verwendet wird und die Repository-Signaturen verifiziert werden können.
--------------------------------------------------

b) Als nächstes aus Eurer Anleitung
pip install influxdb-client

Klappt so nur in einer env Umgebung, aber nicht global.

Um das zu umgehen:
InfluxDB-Client aus folgender Quellen installieren:
wget https://github.com/influxdata/influxdb- ... master.zip

Entpacke die Datei:
unzip master.zip

Geht natürlich nur, wenn:
sudo apt install unzip
installiert wurde.

Navigation in das entpackte Verzeichnis und Installation des InfluxDB-Client:
cd influxdb-client-python-master
sudo python3 setup.py install

Überprüfung, ob influxdb für python installiert ist:
1. Öffne ein Terminal.
2. Starte eine Python-Interpreter-Session: python3
3. Importiere das InfluxDB-Client-Modul:python
import influxdb_client
Wenn keine Fehlermeldung erscheint wurde der InfluxDB-Client erfolgreich installiert

Und schon hatte ich mit dem Rest der Anleitung von Euch InfluxDB und Grafana am Laufen!
Viele Grüße
Andreas
User avatar
dirk
KUNBUS
Posts: 2242
Joined: 15 Dec 2016, 13:19

Re: Installation InfluxDB2 funktioniert nicht

Post by dirk »

Hallo Andreas, klasse vielen Dank für deine wichtige Arbeit, das wird helfen, unsere Dokumentation hier zu aktualisieren.
Post Reply