如何解决在生产环境中将表脚本保存在bigtable中的最佳方法是什么
请让我知道在生产环境中将表脚本保存在bigtable中的最佳方法是什么。 示例:像在数据库中一样,我们可以保存.sql脚本并使用shell文件执行。
是否有任何类似的方法将表ddl脚本保存在bigtable中。
解决方法
您可以使用CBT命令行工具创建和定义表,一旦您确定了模式,就可以将这些命令放入外壳文件中。当前无法导出架构。
CBT工具可以创建表,列族,垃圾回收,行拆分,因此它应该为您提供所需的所有功能。 这是来自文档https://cloud.google.com/bigtable/docs/cbt-reference#create_a_table
的示例cbt createtable <table-id> [families=<family>:gcpolicy=<gcpolicy-
expression>,...]
[splits=<split-row-key-1>,<split-row-key-2>,...]
families Column families and their associated garbage collection (gc) policies.
Put gc policies in quotes when they include shell operators && and ||. For gcpolicy,see "setgcpolicy".
splits Row key(s) where the table should initially be split
Example: cbt createtable mobile-time-series "families=stats_summary:maxage=10d||maxversions=1,stats_detail:maxage=10d||maxversions=1" splits=tablet,phone
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。