InfluxDB: Unterschied zwischen den Versionen

Aus Hackerspace Ffm
Wechseln zu: Navigation, Suche
Zeile 35: Zeile 35:
 
   influx -username grafana -password <passwort> -host localhost
 
   influx -username grafana -password <passwort> -host localhost
 
   use openhab_db
 
   use openhab_db
 +
 +
== Command Line ==
 +
 +
  influx -username grafana -password <passwort>
 +
  show databases
 +
  use openhab_db
 +
  show measurements // tables
 +
  select * from cpu_temp

Version vom 20. Juli 2018, 20:55 Uhr

Hoch effiziente in Go geschriebene Opensource-Datenbank für Zeitreihen wie IoT-Sensordaten und Echtzeitanalysen

Installation

 curl -sL https://repos.influxdata.com/influxdb.key | sudo apt-key add -
 echo "deb https://repos.influxdata.com/debian stretch stable" | sudo tee /etc/apt/sources.list.d/influxdb.list
 sudo apt update
 sudo apt install influxdb telegraf
 sudo systemctl enable influxdb
 sudo systemctl start influxdb

Konfigurieren

 influx
 
 > CREATE DATABASE openhab_db
 > CREATE USER admin WITH PASSWORD '<passwort>' WITH ALL PRIVILEGES
 > CREATE USER openhab WITH PASSWORD '<passwort>'
 > CREATE USER grafana WITH PASSWORD '<passwort>'
 > GRANT ALL ON openhab_db TO openhab
 > GRANT READ ON openhab_db TO grafana
 > exit

Authentifizierung für http in Konfigurationsdatei /etc/influxdb/influxdb.conf eintragen

 [http]  
 enabled = true  
 bind-address = ":8086"
 auth-enabled = true

Service neu starten

 sudo systemctl restart influxdb.service

Testen ob es geht

 influx -username grafana -password <passwort> -host localhost
 use openhab_db

Command Line

 influx -username grafana -password <passwort>
 show databases
 use openhab_db
 show measurements // tables
 select * from cpu_temp