InfluxDB er en open-source tidsseriedatabase designet til høje skrive- og forespørgselsbelastninger. Denne guide forklarer, hvordan du installerer, konfigurerer og får adgang til InfluxDB på Ubuntu 20.10.
Trin 1: Tilføj InfluxDB-repository
wget -q -O /tmp/influxdb.key https://repos.influxdata.com/influxdb.key
sudo apt-key add /tmp/influxdb.key
sudo sh -c 'echo "deb https://repos.influxdata.com/ubuntu bionic stable" > /etc/apt/sources.list.d/influxdb.list'Trin 2: Opdatér pakker
sudo apt updateTrin 3: Installer InfluxDB
sudo apt install influxdbTrin 4: Start og aktivér tjenesten
sudo systemctl start influxdb
sudo systemctl enable --now influxdbTrin 5: Kontrollér service status
sudo systemctl status influxdbTrin 6: Konfigurér InfluxDB
Redigér konfigurationsfilen:
/etc/influxdb/influxdb.confAktivér HTTP-interface ved at fjerne kommentarer fra de relevante indstillinger. Genstart tjenesten efter ændringer:
sudo systemctl stop influxdb
sudo systemctl start influxdbTrin 7: Opret administratorbruger
curl -XPOST "https://localhost:8086/query" --data-urlencode "q=CREATE USER influxdbadmin WITH PASSWORD 'StrongPassword' WITH ALL PRIVILEGES"Trin 8: Få adgang til InfluxDB
influx -username 'influxdbadmin' -password 'StrongPassword'
CREATE DATABASE sysadminxpert_DBKør queries med HTTP
curl -G https://localhost:8086/query -u influxdbadmin:StrongPassword --data-urlencode "q=SHOW DATABASES"Tillad firewall-adgang
sudo ufw allow 8086/tcpInfluxDB er nu installeret og klar til tidsseriedata og forespørgsler.