如何增加HBase表中的区域数量

Ram*_*man 5 hadoop hbase

我在HBase中创建了一个表,其中包含8个区域的预分割,HexStringSplit作为分割算法.现在我想增加区域数量,而不会破坏现有的表格及其中的数据.我创建预分割的命令是

create 't1', 'f1', {NUMREGIONS => 15, SPLITALGO => 'HexStringSplit'}

因为它是我不能再次执行此命令来增加区域的数量.是否有任何命令可用于更新现有表中的区域数量?

Rub*_*eda 7

请注意,您提供的命令会创建15个区域,而不是8个区域: create 't1', 'f1', {NUMREGIONS => 15, SPLITALGO => 'HexStringSplit'}

您可以使用split命令拆分区域:

hbase(main):001:0> split

Here is some help for this command:
Split entire table or pass a region to split individual region.  With the
second parameter, you can specify an explicit split key for the region.
Examples:
    split 'tableName'
    split 'regionName' # format: 'tableName,startKey,id'
    split 'tableName', 'splitKey'
    split 'regionName', 'splitKey'
Run Code Online (Sandbox Code Playgroud)

您应该使用split 'regionName', 'splitKey'或者split 'tableName', 'splitKey',不要忘记为每个区域提供适当的SplitKey(中间区域)以确保均匀分布.您可以在http:// your-hbase-master:60010/table.jsp?name = your-table中查看当前区域

即:如果你有一个区域有StartKey 20000000和EndKey 40000000你的splitKey将是30000000,或者,如果你有一个区域有StartKey 20000000和EndKey 30000000你的SplitKey将是28000000(记住,它是HEX)

请先使用测试表进行测试,直到您对该过程充满信心.