关于influxdb:influxdb-使用

2次阅读

共计 615 个字符,预计需要花费 2 分钟才能阅读完成。

在 InfluxDB 当中,并没有表(table)这个概念,取而代之的是 MEASUREMENTS,MEASUREMENTS 的性能与传统数据库中的表统一,因而咱们也能够将 MEASUREMENTS 称为 InfluxDB 中的表。

create database test17

CREATE USER testuser WITH PASSWORD 'testpwd' ## 创立用户和设置明码
GRANT ALL PRIVILEGES ON cadvisor TO testuser ## 受权数据库给指定用户
CREATE RETENTION POLICY "cadvisor_retention" ON "cadvisor" DURATION 30d REPLICATION 1 DEFAULT ## 创立默认的数据保留策略,设置保留工夫 30 天,正本为 1 
  • 新建表

    InfluxDB 中没有显式的新建表的语句,只能通过 insert 数据的形式来建设新

curl -i -XPOST 'http://localhost:8086/write?db=test' --data-binary 'cpu_load_short,host=server01,region=us-west value=0.64 1434055562000000000'

show retention policies on test;


alter retention policy “autogen” on “test” duration 240h replication 1 default;

正文完
 0