文档文档

influx bucket-schema update

适用于 InfluxDB Cloud 存储桶模式

influx bucket-schema 及其子命令适用于 InfluxDB Cloud 存储桶模式。此功能在 InfluxDB OSS v2.3 中不可用。

influx bucket-schema update 命令更新具有 explicit schema-type 的 InfluxDB 存储桶的模式。

bucket-schema update 需要至少定义一个模式的存储桶。

用法

influx bucket-schema update [flags]
支持的操作
  • 将新列添加到模式
不支持的操作
  • 修改模式中的现有列
  • 从模式中删除列

标志

标志描述输入类型映射到 ?
-c--active-config用于命令的 CLI 配置字符串
-n--bucket(必需) 存储桶名称(与 --bucket-id 互斥)字符串
-i--bucket-id(必需) 存储桶 ID(与 --bucket 互斥)字符串
--columns-file(必需) 列定义文件的路径。 有关更多信息,请参见 创建列文件字符串
--columns-format列文件格式(csvndjsonjson,默认值:auto)。 有关更多信息,请参见 使用列格式更新模式字符串
--configs-pathinflux CLI 配置的路径(默认 ~/.influxdbv2/configs字符串INFLUX_CONFIGS_PATH
-x--extended-output打印每个测量模式的列信息(默认值:false)
-h--helpcreate 命令的帮助
--hide-headers隐藏表头(默认值 falseINFLUX_HIDE_HEADERS
--hostInfluxDB 的 HTTP 地址(默认值 https://127.0.0.1:8086字符串INFLUX_HOST
--json将数据输出为 JSON(默认值 falseINFLUX_OUTPUT_JSON
-n--name(必需) 测量名称字符串
-o--org组织名称(与 --org-id 互斥)字符串INFLUX_ORG
--org-id组织 ID(与 --org 互斥)字符串INFLUX_ORG_ID
--skip-verify跳过 TLS 证书验证INFLUX_SKIP_VERIFY
-t--tokenAPI 令牌字符串INFLUX_TOKEN

示例

身份验证凭据

以下示例假定您的 InfluxDB hostorganizationtoken活动的 influx CLI 配置 或环境变量(INFLUX_HOSTINFLUX_ORGINFLUX_TOKEN)提供。如果您没有设置 CLI 配置或设置环境变量,请使用以下标志为每个命令包含这些必需的凭据

  • --host: InfluxDB 主机
  • -o, --org--org-id: InfluxDB 组织名称或 ID
  • -t, --token: InfluxDB API 令牌

使用 influx CLI 更新模式

influx bucket-schema update \
  --bucket example-bucket \
  --name temperature \
  --columns-file columns.csv

更新模式并打印列信息

influx bucket-schema update \
  --bucket example-bucket \
  --name cpu \
  --columns-file columns.csv \
  -extended-output

使用列格式更新模式

默认情况下,InfluxDB 尝试检测 columns file 格式。如果文件的扩展名与格式不匹配,请使用 columns-format 标志设置格式。

influx bucket-schema update \
  --bucket example-bucket \
  --name cpu \
  --columns-file columns.json \
  --columns-format ndjson
influx bucket-schema update \
  --bucket example-bucket \
  --name cpu \
  --columns-file columns.txt \
  --columns-format csv

此页面是否对您有帮助?

感谢您的反馈!


Flux 的未来

Flux 即将进入维护模式。 您可以继续按目前的方式使用它,无需更改任何代码。

阅读更多

InfluxDB 3 开源版现在已发布 Public Alpha

InfluxDB 3 开源版现已推出 Alpha 测试版,根据 MIT 或 Apache 2 许可授权。

我们正在发布两种产品作为 Alpha 的一部分。

InfluxDB 3 Core 是我们的新开源产品。 它是用于时间序列和事件数据的最新数据引擎。 InfluxDB 3 Enterprise 是一个商业版本,它建立在 Core 的基础上,增加了历史查询功能、读取副本、高可用性、可扩展性和细粒度的安全性。

有关如何入门的更多信息,请查看