Use the following procedure to enable HA for HBase:
Add the following server-side properties in the
hbase-site.xml
configuration file for the HBase server:Table 9.1. Server-side HBase HA Configuration Properties
Configuration Property Description hbase.regionserver.storefile.refresh.period
The period, in milliseconds, for refreshing the data store files of secondary regions. The default value of 0
indicates that the HA feature is disabled. Note that too frequent refreshes can place an additional load on the NameNode. Read requests are rejected if these store files cannot be refreshed for longer than the HFILE TTL period specifed with thehbase.master.loadbalancer.class
configuration property.hbase.master.loadbalancer.class
The Java class used for balancing the load of all HBase clients. The default value is org.apache.hadoop.hbase.master.balancer.StochasticLoadBalancer
, the only load balancer that supports reading data from secondary regions.Add the following client-side properties in the
hbase-site.xml
configuration properties for the HBase client:Table 9.2. Client-side HBase HA Configuration Properties
Configuration Property Description hbase.ipc.client.allowsInterrupt
Whether to enable interruption of the Remote Procedure Call, or RPC, threads for the client. The default value of true
is required to enable primary regions to access secondary regions.hbase.client.primaryCallTimeout.get
The timeout period, in milliseconds, before the RPCs for an HBase client are submitted to a secondary region with timeline data consistency. The default value is 10
.hbase.client.primaryCallTimeout.multiget
The timeout period, in milliseconds, before the RPCs for an HBase client's multi-get request, such as HTable.get(List<GET>))
, is submitted to a secondary region with timeline data consistency. The default value is10
. Lower values increase the number of RPCs but will also lower latency.Restart the HBase servers.