如何增加HBase表中的区域数量 [英] How to increase number of regions in an HBase table

查看:694
本文介绍了如何增加HBase表中的区域数量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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



因为我不能再次执行这个命令来增加区域的数量。有没有更新现有表中区域数量的命令?

解决方案

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



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

  HBase的(主):001:0> split 

下面是这个命令的一些帮助:
拆分整个表格或传递一个区域来拆分单个区域。使用
秒参数,您可以为区域指定显式分割键。
示例:
split'tableName'
split'regionName'#format:'tableName,startKey,id'
split'tableName','splitKey'
split' regionName','splitKey'

您应该使用 split'regionName',' splitKey' split'tableName','splitKey',只是不要忘记给每个区域提供正确的SplitKey确保均匀分配。您可以在 http:// your-hbase-master: 60010 / table.jsp?name =你的表格



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

请先用测试表尝试,直到你感到足够自信与过程。

I have created a table in HBase with a pre split of 8 regions, with HexStringSplit as spliting algorithm. Now I want to increase the number of regions, without destroying the existing table and the data in it. The command with which I created the pre split was

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

As it is I cannot execute this command again for increasing the number of regions. Is there any command present for updating the number of regions in an existing table?

解决方案

Please notice that the command you provide creates 15 regions, not 8: create 't1', 'f1', {NUMREGIONS => 15, SPLITALGO => 'HexStringSplit'}

You can split regions with the split command:

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'

You should use split 'regionName', 'splitKey' or split 'tableName', 'splitKey', just do not forget to provide the proper SplitKey (the mid one) to each region to ensure even distribution. You can see the current regions at http://your-hbase-master:60010/table.jsp?name=your-table

i.e: if you have a region with StartKey 20000000 and EndKey 40000000 your splitKey would be 30000000, or, if you have a region with StartKey 20000000 and EndKey 30000000 your SplitKey would be 28000000 (remember, it's HEX)

Please try it first with test tables until you feel confident enough with the process.

这篇关于如何增加HBase表中的区域数量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆