# Configuration details

Know the necessary configuration properties required to use the stochastic load balancer in the HBase cluster.

## Configuration steps

- Log in to Cloudera Manager as an Administrator.
- Go to .
- Search for the HBase Service Advanced Configuration Snippet (Safety Valve) for hbase-site.xml property and add the following configuration properties.

## hbase.master.balancer.maxRitPercent

This parameter defines the maximum number of regions that can be in transition at any point in time during balancing. The balancer uses this value to calculate the region plan such that the number of regions in transition is within this limit. For example, a value of 0.01 means that up to 1% of the total number of regions can be in transition during the balancer run.

## hbase.master.balancer.stochastic.maxRunningTime

Defines the maximum amount of time for which the balancer runs in a single invocation. The default value for this parameter is 30 seconds.

## hbase.master.balancer.stochastic.minCostNeedBalance

The balancer tries to balance the cluster if the overall cost of the balancer is more than the minCostNeedBalance parameter. This parameter ensures that the balancer does not move the regions even if the cluster is slightly off-balanced and hence avoids any unwanted balancer runs. The default value of this balancer is 0.025. The total cost of the balancer is calculated by considering the individual costs returned by the individual cost functions in the balancer.

## hbase.master.balancer.stochastic.numRegionLoadsToRemember

The master node periodically receives the statistics from each online region server. This statistic is used by the stochastic load balancer to calculate different costs needed by the balancer to calculate the total cost of the balancer. In some cases, the balancer needs to calculate the rolling averages of the statistics received from the region servers. This parameter defines the number of statistics received from a region server which is then used to calculate the rolling averages. The default value of this parameter is 15 which means the master will maintain up to 15 sets of statistics from a region server.

## hbase.master.balancer.stochastic.runMaxSteps

This is a boolean parameter with the default value as false. This parameter defines the number of steps taken by the balancer to calculate the cost of the balancer. If runMaxSteps is true, then the balancer considers the maximum number of steps calculated by the balancer. The maximum number of steps to be taken by the parameter is calculated as the maximum value of maxSteps defined by the configuration hbase.master.balancer.stochastic.maxSteps.

maxSteps = max(valueof(hbase.master.balancer.stochastic.maxSteps), number of regions * valueof(hbase.master.balancer.stochastic.stepsPerRegion) * number of servers)

If this parameter is set to false, then the maximum number of steps is calculated as:

min(valueof(hbase.master.balancer.stochastic.maxSteps), number of regions * valueof(hbase.master.balancer.stochastic.stepsPerRegion) * number of servers)

## hbase.master.balancer.stochastic.maxSteps

This is the maximum number of steps to be taken by the balancer to calculate the region plan. This works along with the hbase.master.balancer.stochastic.runMaxSteps configuration parameter.

## hbase.master.balancer.stochastic.stepsPerRegion

This parameter defines the maximum number of steps calculated for each region as part of the balancer run and thus controls the size of the region plan generated by the balancer. This value is used along with the hbase.master.balancer.stochastic.runMaxSteps configuration parameter.