【问题标题】:How to add new column family to an existing HBase table?如何向现有 HBase 表添加新列族?
【发布时间】:2015-03-27 00:29:17
【问题描述】:

我创建了一个表

create 'tablename', 'columnfamily1'

现在可以添加另一个列族“columnfamily2”吗?方法是什么?

【问题讨论】:

标签: hbase column-family nosql


【解决方案1】:

好像

alter 'tablename', 'columnfamily2'

成功了。 可以先禁用“tablename”。但是,即使启用它也能正常工作。

hbase(main):015:0> alter 'tablename', {NAME=> 'columnfamily2'}
Updating all regions with the new schema...
0/1 regions updated.
1/1 regions updated.
Done.

【讨论】:

  • 如果“base.online.schema.update.enable”未设置为“true”,则需要禁用和启用表
【解决方案2】:
alter 'tablename', NAME => 'newcolumnfamily', VERSIONS => 50

您可以指定新列族的各种属性,用逗号 (,) 分隔

【讨论】:

    【解决方案3】:

    如果您考虑使用一些 GUI 解决方案,则可以使用 HAdmin 轻松完成。只需在“更改表”页面中按“+”按钮,然后添加您需要的所有设置的新列族。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-11-27
      • 2017-06-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多