使用gcloud设置谷歌bigtable的ttl

问题描述 投票:1回答:2

我使用aws dynamo db并在一段时间后使用ttl属性删除记录但现在我转向GCP,

在大表中我可以设置值的到期时间,因此我使用Bigtable而不是Google Datastore

我知道我可以使用Go CLI使用命令设置它

cbt setgcpolicy my-table cf1 maxage = 1d

但我想使用gcloud cli或使用控制台或部署管理器创建它

提前致谢

google-cloud-bigtable
2个回答
2
投票

This Deployment Manager example应该帮助设置GC规则:

tables:
  data:
    granularity: MILLIS
    columnFamilies:
      foo:
        gcRule:
          maxNumVersions: 2
      bar:
        gcRule:
          maxNumVersions: 2

您无法通过gcloud或Google Cloud Console执行此操作。


0
投票

cbt工具以Cloud SDK component的形式提供。您可以通过运行以下命令来检查它是否已安装:

gcloud components list

如果未安装,则可以运行:

gcloud components update
gcloud components install cbt

之后,您应该能够在云shell中运行相同的cbt命令。

© www.soinside.com 2019 - 2024. All rights reserved.