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.sh
file for each RegionServer, or in thehbase-env.sh
file supplied to Ambari, set the-XX:MaxDirectMemorySize
argument forHBASE_REGIONSERVER_OPTS
to the amount of direct memory you want to allocate to HBase.In the sample configuration, the value would be
110592m
(-XX:MaxDirectMemorySize
accepts a number followed by a unit indicator;m
indicates megabytes);HBASE_OPTS="$HBASE_OPTS -XX:MaxDirectMemorySize=110592m"
-
In the
hbase-site.xml
file, specify the BucketCache size.For the sample configuration, the values would be
120832
and0.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.xml
file, sethbase.bucketcache.ioengine
tooffheap
to 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.