Know how to configure automatic split policy in an HBase table.
When a region in an HBase table reaches a certain limit, HBase automatically divides
it into two regions. This is the HBase default split policy. However, you can
override the default split policy and configure a custom split policy for the
regions in an HBase table.
Using the Cloudera Manager, you can configure the default split policy at the system
level or the table level using the HBase shell.
In this topic, let us consider an example of configuring the split policy for regions
in an HBase table by setting the
hbase.regionserver.region.split.policy parameter.
Ensure that you have administrator privileges in the CDP environment.
-
Log in to the Cloudera Manager as an administrator.
-
Select the HBase service.
-
Go to .
-
Configure the split policy that you need.
For example, to set the split policy for the regions in an HBase table set the
value of
hbase.regionserver.region.split.policy as
org.apache.hadoop.hbase.regionserver.ConstantSizeRegionSplitPolicy
.
For
more information on custom policies, see HBase custom split
policies.
-
Click Save Changes.
-
Restart the HBase service.
Alternatively, you can use the HBase shell to set the split policy for the
regions at the table level.
- Log in to the HBase shell.
- Use the ALTER command to set the value to
org.apache.hadoop.hbase.regionserver.ConstantSizeRegionSplitPolicy
.The
following is a sample
command.
$ hbase shell
$ hbase > alter '<TABLE_NAME>', {METADATA => {'SPLIT_POLICY' => 'org.apache.hadoop.hbase.regionserver.ConstantSizeRegionSplitPolicy'}}