Skip to content

Installation von InfluxDB auf Debian 12

Installation

1. InfluxDB Repository hinzufügen

wget -qO- https://repos.influxdata.com/influxdb.key | sudo tee /etc/apt/trusted.gpg.d/influxdb.gpg >/dev/null
echo "deb [signed-by=/etc/apt/trusted.gpg.d/influxdb.gpg] https://repos.influxdata.com/debian bookworm stable" | sudo tee /etc/apt/sources.list.d/influxdb.list >/dev/null

2. Debian Paketquellen aktualisieren

sudo apt update

3. InfluxDB installieren

sudo apt install influxdb2 -y

4. Konfigurieren

In unserem Fall möchten wir das Interface an der InfluxDB lauscht, auf localhost binden.

sudo vi /etc/influxdb/config.toml
http-bind-address = "127.0.0.1:8086"

5. Service Starten

sudo systemctl start influxdb

6. Prüfen

Mit systemctl status lassen wir uns den Status des Services anzeigen.

sudo systemctl status influxd

Mit netstat prüfen wir, ob der InfluxDB Service auch wirklich an localhost auf Port 8086 läuft.

netstat -nl | grep 8086
tcp        0      0 127.0.0.1:8086          0.0.0.0:*               LISTEN

7. Ersteinrichtung von InfluxDB

Nun rufen wir das InfluxDB-CLI-Tool auf und richten unseren erste Organisation und den ersten Benutzer ein.

influx setup
> Welcome to InfluxDB 2.0!
? Please type your primary username tux
? Please type your password **********
? Please type your password again **********
? Please type your primary organization name example24
? Please type your primary bucket name iot-data
? Please type your retention period in hours, or 0 for infinite 0
? Setup with these parameters?
  Username:          tux
  Organization:      example24
  Bucket:            iot-data
  Retention Period:  infinite
 Yes
User    Organization    Bucket
tux     example24   iot-data

Probleme

Ich hatte das Problem, dass beim Aktualisieren der Debian Paketquellen ein Fehler angezeigt wurde, dass der öffentliche Schlüssel D8FF8E1F7DF8B07E nicht verfügbar ist. Folgende Schritte haben das Problem behoben.

Wir laden uns den influxdata-archive_compat.key von https://repos.influxdata.com/influxdata-archive_compat.key herunter.

wget -q https://repos.influxdata.com/influxdata-archive_compat.key

Prüfen mit gpg ob der Key gültig ist.

gpg --with-fingerprint --show-keys ./influxdata-archive_compat.key

Nun überschreiben wir unseren bereits installierten Key mit folgenden Befehl.

cat influxdata-archive_compat.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/influxdb.gpg >/dev/null

Nun funktionierte das aktualisieren der Debian Paketquellen. Den herrunter geladenen Key können wir nun wieder löschen.

rm influxdata-archive_compat.key