请注意,您提供的命令创建了 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'
你应该使用split 'regionName', 'splitKey'
or split 'tableName', 'splitKey'
,只是不要忘记向每个区域提供适当的 SplitKey(中间的)以确保均匀分布。您可以在以下位置查看当前区域:http://your-hbase-master:60010/table.jsp?name=your-table http://your-hbase-master:60010/table.jsp?name=your-table
即:如果您有一个 StartKey 20000000 和 EndKey 40000000 的区域,您的 splitKey 将为 30000000,或者,如果您有一个 StartKey 20000000 和 EndKey 30000000 的区域,您的 SplitKey 将为 28000000(请记住,它是十六进制)
请首先使用测试表进行尝试,直到您对该过程有足够的信心为止。