Adgang
- Som standard lytter InfluxDB 3 Core på:
http://<SERVER_IP>:8181 - Sikker port
8181/tcpskal være åben ved fjernadgang.
Godkendelse og tokens
- InfluxDB 3 Core bruger tokenbaseret godkendelse.
- Opret admin-tokenet (operator):
influxdb3 create token --admin - Tokenet vises kun én gang.
- Gem det sikkert - det kan ikke hentes igen.
Vigtige filer og mapper
- Konfigurationsfil:
/etc/influxdb3/influxdb3-core.conf - Datamappe:
/var/lib/influxdb3/data - Pluginmappe:
/var/lib/influxdb3/plugins - Systemd-tjeneste:
influxdb3-core
Servicestyrring
Stop tjenesten:
systemctl stop influxdb3-core
Start tjenesten:
systemctl start influxdb3-core
Genstart tjenesten:
systemctl restart influxdb3-core
Kontroller status:
systemctl status influxdb3-core
Se logfiler:
journalctl -u influxdb3-core -f
Grundlæggende brug (CLI)
Vis tilgængelige databaser:
influxdb3 show databases --token <AUTH_TOKEN>
Brug write Kommando til 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"