如何增加hbase表中的区域数

omqzjyyz  于 2021-05-30  发布在  Hadoop
关注(0)|答案(1)|浏览(433)

我在hbase中创建了一个表,其中预拆分了8个区域,并使用hexstringsplit作为拆分算法。现在我想增加区域的数量,而不破坏现有的表和其中的数据。我创建预拆分的命令是 create 't1', 'f1', {NUMREGIONS => 15, SPLITALGO => 'HexStringSplit'} 因为它是我不能执行这个命令再次增加地区的数量。是否存在用于更新现有表中区域数的命令?

gpfsuwkq

gpfsuwkq1#

请注意,您提供的命令将创建15个区域,而不是8个: create 't1', 'f1', {NUMREGIONS => 15, SPLITALGO => 'HexStringSplit'} 可以使用“拆分”命令拆分区域:

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'

你应该使用 split 'regionName', 'splitKey' 或者 split 'tableName', 'splitKey' ,只是不要忘记为每个区域提供适当的splitkey(中间的splitkey),以确保均匀分布。您可以在以下位置查看当前区域:http://your-hbase-master:60010/table.jsp?name=您的表
i、 e:如果您有一个startkey 20000000和endkey 40000000的区域,您的splitkey将是30000000,或者,如果您有一个startkey 20000000和endkey 30000000的区域,您的splitkey将是28000000(记住,它是十六进制的)
请先用测试表试试,直到你对这个过程有足够的信心。

相关问题