We have been implementing our product to support real time queries on HBase(version 0.94.0 with hadoop-1.0.0) & to improve performance of read & write operation, I have tunned hadoop/hbase configuration.
I will try to summaries all exceptions got in CRUD operation with their corresponding configuration changes to resolve that.
I will try to summaries all exceptions got in CRUD operation with their corresponding configuration changes to resolve that.
- LeaseExpiredException/UnknownScannerException/ScannerTimeoutException:
About this more information, can be find
here.
Exception: org.apache.hadoop.hbase.regionserver.LeaseException: lease '*************' does not exist .
Changes in conf/hbase-site.xml:
<property>
<name>hbase.regionserver.lease.period</name>
<value>1200000</value>
</property>
<property>
<name>hbase.rpc.timeout</name>
<value>1200000</value>
</property>
Changes in conf/hbase-site.xml:
<property>
<name>zookeeper.session.timeout</name>
<value>20000</value>
</property>
Changes in conf/hbase-site.xml:
<property>
<name>hbase.regionserver.handler.count</name>
<value>50</value>
</property>
org.apache.hadoop.hbase.ZooKeeperConnectionException: org.apache.zookeeper.KeeperException$ConnectionLossException:KeeperErrorCode = ConnectionLoss for /hbase
Changes in conf/hbase-site.xml:
<property>
<name>hbase.zookeeper.property.maxClientCnxns</name>
<value>1000</value>
</property>
Changes in conf/hbase-site.xml:
<property>
<name>hbase.client.scanner.caching</name>
<value>100</value>
</property>
Changes in conf/hbase-site.xml:
<property>
<name>hbase.hregion.max.filesize</name>
<value>10737418240</value>
</property>
Changes in conf/hbase-site.xml:
<property>
<name>hbase.hregion.majorcompaction</name>
<value>0</value>
</property>
To stop blocking of update operation, we increased blockMultiplier(default 2) to 4 & blockingStoreFiles(number of storeFiles in a store, default 7) to 30.
For more information, find here:
Changes in conf/hbase-site.xml:
<property>
<name>hbase.hregion.memstore.flush.size</name>
<value>134217728</value>
</property>
<property>
<name>hbase.hregion.memstore.block.multiplier</name>
<value>4</value>
</property>
<property>
<name>hbase.hstore.blockingStoreFiles</name>
<value>30</value>
</property>
Exception: OutOfMemoryExceptions
Changes in conf/hbase-env.sh:
export HBASE_HEAPSIZE=4000
export HBASE_REGIONSERVER_OPTS="$HBASE_REGIONSERVER_OPTS -Xms8000m -Xmx8000m"
Exception: java.lang.OutOfMemoryError: GC overhead limit exceeded
To avoid longer GC pause, we configured GC in such way:
Changes in conf/hbase-env.sh:
export HBASE_OPTS="$HBASE_OPTS -server -XX:+HeapDumpOnOutOfMemoryError -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=70 -XX:NewSize=64m -XX:MaxNewSize=64m -XX:+CMSIncrementalMode -Djava.net.preferIPv4Stack=true"
Exception: Could not obtain block blk_***_**** from any node: java.io.IOException: No live nodes contain current block. Will get new block locations from namenode and retry...
Changes in conf/hdfs-site.xml:
<property>
<name>dfs.datanode.max.xcievers</name>
<value>2048</value>
</property>
Exception: org.apache.hadoop.hbase.regionserver.LeaseException: lease '*************' does not exist .
Changes in conf/hbase-site.xml:
<property>
<name>hbase.regionserver.lease.period</name>
<value>1200000</value>
</property>
<property>
<name>hbase.rpc.timeout</name>
<value>1200000</value>
</property>
- Zookeeper Session TimeOut:
Changes in conf/hbase-site.xml:
<property>
<name>zookeeper.session.timeout</name>
<value>20000</value>
</property>
- RegionServer Handler Count:
Changes in conf/hbase-site.xml:
<property>
<name>hbase.regionserver.handler.count</name>
<value>50</value>
</property>
- Zookeeper MaxClient Connection:
Number of concurrent connections may make to a single member of the ZooKeeper ensemble. It should set high to avoid zk connection loss issues. By default, it is set to 300. I configured it to 1000.
Exception:
org.apache.hadoop.hbase.ZooKeeperConnectionException: org.apache.zookeeper.KeeperException$ConnectionLossException:KeeperErrorCode = ConnectionLoss for /hbase
<property>
<name>hbase.zookeeper.property.maxClientCnxns</name>
<value>1000</value>
</property>
- Scanner Caching Size:
Changes in conf/hbase-site.xml:
<property>
<name>hbase.client.scanner.caching</name>
<value>100</value>
</property>
- Maximum HStore file Size:
Changes in conf/hbase-site.xml:
<property>
<name>hbase.hregion.max.filesize</name>
<value>10737418240</value>
</property>
- Major Compaction:
Changes in conf/hbase-site.xml:
<property>
<name>hbase.hregion.majorcompaction</name>
<value>0</value>
</property>
- Memstore File Size:
To stop blocking of update operation, we increased blockMultiplier(default 2) to 4 & blockingStoreFiles(number of storeFiles in a store, default 7) to 30.
For more information, find here:
Changes in conf/hbase-site.xml:
<property>
<name>hbase.hregion.memstore.flush.size</name>
<value>134217728</value>
</property>
<property>
<name>hbase.hregion.memstore.block.multiplier</name>
<value>4</value>
</property>
<property>
<name>hbase.hstore.blockingStoreFiles</name>
<value>30</value>
</property>
- HeapSize of HBase:
Exception: OutOfMemoryExceptions
Changes in conf/hbase-env.sh:
export HBASE_HEAPSIZE=4000
export HBASE_REGIONSERVER_OPTS="$HBASE_REGIONSERVER_OPTS -Xms8000m -Xmx8000m"
- GC Configuration:
Exception: java.lang.OutOfMemoryError: GC overhead limit exceeded
To avoid longer GC pause, we configured GC in such way:
Changes in conf/hbase-env.sh:
export HBASE_OPTS="$HBASE_OPTS -server -XX:+HeapDumpOnOutOfMemoryError -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=70 -XX:NewSize=64m -XX:MaxNewSize=64m -XX:+CMSIncrementalMode -Djava.net.preferIPv4Stack=true"
- Datanode Xcievers:
Exception: Could not obtain block blk_***_**** from any node: java.io.IOException: No live nodes contain current block. Will get new block locations from namenode and retry...
Changes in conf/hdfs-site.xml:
<property>
<name>dfs.datanode.max.xcievers</name>
<value>2048</value>
</property>