Configure BucketCache
To configure BucketCache, you have to specify values for certain parameters in
the hbase-env.sh and hbase-site.xml files.
-
In the
hbase-env.shfile for each RegionServer, or in thehbase-env.shfile supplied to Ambari, set the-XX:MaxDirectMemorySizeargument forHBASE_REGIONSERVER_OPTSto the amount of direct memory you want to allocate to HBase.In the sample configuration, the value would be
110592m(-XX:MaxDirectMemorySizeaccepts a number followed by a unit indicator;mindicates megabytes);HBASE_OPTS="$HBASE_OPTS -XX:MaxDirectMemorySize=110592m" -
In the
hbase-site.xmlfile, specify the BucketCache size.For the sample configuration, the values would be
120832and0.89830508474576, respectively. You can round up the proportion. This allocates space related to the rounding error to the (larger) off-heap memory area.<property> <name>hbase.bucketcache.size</name> <value>108544</value> </property> -
In the
hbase-site.xmlfile, sethbase.bucketcache.ioenginetooffheapto enable BucketCache:<property> <name>hbase.bucketcache.ioengine</name> <value>offheap</value> </property>
- Restart (or perform a rolling restart on) the cluster. It can take a minute or more to allocate BucketCache, depending on how much memory you are allocating. Check logs for error messages.

