1 InfluxDB 列出存在的数据库(所有操作须进入influx操作命令行)

    show databases

Influxdb 基础知识

2 新建数据库

    create database dbname(eg test)

Influxdb 基础知识

3  使用某一个数据库

    use dbname(eg test)

Influxdb 基础知识

4 显示所有数据表

    show measurements

Influxdb 基础知识

5 删除表

    drop measurement table_name(eg data_table)

6 查询数据的保存策略

    show retention policies on db_name(eg test)

Influxdb 基础知识

7  创建新的Retention policies

    create retention policy '策略名‘ on 'db_name' duration 3w relicaiton 1 default

    rp_name:策略名;

    db_name:具体的数据库名;

    3w:保存3周,3周之前的数据将被删除,influxdb具有各种事件参数,比如:h(小时),d(天),w(星期);

    replication 1:副本个数,一般为1就可以了;

    default:设置为默认策略

 

 

 

 

 

相关文章:

  • 2021-12-06
猜你喜欢
  • 2021-11-23
  • 2021-10-27
  • 2022-12-23
  • 2021-05-21
  • 2021-06-12
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案