Adgang
- Som standard lytter InfluxDB 3 Core på:
http://<SERVER_IP>:8181 - Sørg for port
8181/tcper åben, hvis du fjernadgang.
Autentificering og tokens
- InfluxDB 3 Core bruger token-baseret godkendelse.
- Opret admin (operatør) token:
influxdb3 create token --admin - Tokenet vises kun én gang.
- Opbevar det sikkert, det kan ikke hentes senere.
Vigtige filer og mapper
- Konfigurationsfil:
/etc/influxdb3/influxdb3-core.conf - Datamappe:
/var/lib/influxdb3/data - Plugin bibliotek:
/var/lib/influxdb3/plugins - Systemd service:
influxdb3-core
Service-håndtering
Stop tjenesten:
systemctl stop influxdb3-core
Start tjenesten:
systemctl start influxdb3-core
Genstart tjenesten:
systemctl restart influxdb3-core
Tjek status:
systemctl status influxdb3-core
Se logs:
journalctl -u influxdb3-core -f
Grundlæggende brug (CLI)
Vis tilgængelige databaser:
influxdb3 show databases --token <AUTH_TOKEN>
Brug write kommando for at indsætte data:
influxdb3 write
--database <DATABASE_NAME>
--token <AUTH_TOKEN>
--precision s
'home,room=Living Room temp=21.1,hum=35.9,co=0i 1641024000
home,room=Kitchen temp=21.0,hum=35.9,co=0i 1641024000
home,room=Living Room temp=21.4,hum=35.9,co=0i 1641027600
home,room=Kitchen temp=23.0,hum=36.2,co=0i 1641027600
home,room=Living Room temp=21.8,hum=36.0,co=0i 1641031200
home,room=Kitchen temp=22.7,hum=36.1,co=0i 1641031200'
Kør SQL-forespørgsler mod din database:
influxdb3 query
--database <DATABASE_NAME>
--token <AUTH_TOKEN>
"SELECT * FROM home ORDER BY time"