curl -sL https://repos.influxdata.com/influxdb.key | sudo apt-key add -
source /etc/os-release
echo "deb https://repos.influxdata.com/debian ${VERSION_CODENAME} stable" | sudo tee /etc/apt/sources.list.d/influxdb.list
sudo apt update && sudo apt install -y influxdb
sudo systemctl unmask influxdb.service
sudo systemctl start influxdb && sudo systemctl status influxdb
# connect, set timestamp format in rfc3339
influx -precision=rfc3339
# create a new db
> show databases
name: databases
name
----
_internal
mytest
> create database mydb
> show databases
name: databases
name
----
_internal
mytest
mydb
# write & query
> use mydb
Using database mydb
> insert cpu,host=s1,region=asia_east value=0.35
> select host,region,value from cpu
name: cpu
time host region value
---- ---- ------ -----
2019-11-18T07:40:45.353059592Z s1 asia_east 0.35