docker run -d -e INFLUXDB_ADMIN_USER:user1 -e INFLUXDB_ADMIN_PASSWORD:pass1 --name influxdb1 influxdb
docker exec -it influxdb1 influx -host 127.0.0.1 -port 8086 -username user1 -password pass1
show databasescreate database db1
use db1
-- show all tables (=measurements)
show measurements
-- tag/index always string, field can be float, int, bool, etc
insert into table1,tag1=a,tag2=b field1=1,field2=2
-- if not set, default time is in nanosecond of insert time
select * from "table1"
select * from table1 where tag1='a'
-- describe columns from all table:
show tag keys
show field keys from "table1"
-- select distinct tag from table1
show tag values from "table1" with key in ("tag1")
-- automatically delete after N days, default 0 = never delete
-- shard by N hours, default 168 hours (a week)
show retention policies
-- like partition in other database
show shards
show shard groups
I guess that's it what you need to know to get started with InfluxDB. If you're looking one that comparable with Clickhouse, you can check TDEngine or TiFlash.
No comments :
Post a Comment
THINK: is it True? is it Helpful? is it Inspiring? is it Necessary? is it Kind?