How to increase the number of regions in the HBase table

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

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

As I still can not execute this command to increase the number of regions. Is there any command to update the number of regions in an existing table?

+5
source share
1 answer

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

You can split regions using 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 remember to provide the appropriate SplitKey (middle) for each region to ensure even distribution. You can see the current regions in http: // your-hbase-master: 60010 / table.jsp? Name = your-table

ie: if you have an area with StartKey 20,000,000 and EndKey 40,000,000, your splitKey will be 30,000,000, or if you have an area with StartKey 20,000,000 and EndKey 30,000,000, your SplitKey will be 28,000,000 (remember this is a HEX)

Please try first with test patterns until you feel confident enough in the process.

+5
source

All Articles