HBase 问题汇总
1. hbase regionserver频繁挂掉
从日志中没有发现任何错误,网上普遍答案是内存不足,所以修改hbase-env.xml文件。修改为
export HBASE_OPTS="-Xmx5368709120 -XX:+HeapDumpOnOutOfMemoryError -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -Djava.net.preferIPv4Stack=true $HBASE_OPTS"
hbase.regionserver.msginterval改为30s。
zookeeper.session.timeout为120s
hbase.coprocessor.abortonerror 为true。
zookeeper修改
maxSessionTimeout为120s
minSessionTimeout为100s
总结:以上方法暂时不管用
修改HBase Master,HBase REST Server,HBase Thrift Server,HBase RegionServer 的 Java 堆栈大小(字节)为1G后,不在挂机,显示正常。
2. HBase Master和HBase RegionServer频繁挂机
查看Master日志
2018-12-13 09:36:45,304 INFO org.apache.zookeeper.ClientCnxn: Socket connection established, initiating session, client: /192.168.116.140:54834, server: duan140/192.168.116.140:2181
2018-12-13 09:36:45,324 INFO org.apache.zookeeper.ClientCnxn: Unable to read additional data from server sessionid 0x0, likely server has closed socket, closing socket connection and attempting reconnect
2018-12-13 09:36:45,424 ERROR org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper: ZooKeeper create failed after 4 attempts
2018-12-13 09:36:45,427 ERROR org.apache.hadoop.hbase.master.HMasterCommandLine: Master exiting
java.lang.RuntimeException: Failed construction of Master: class org.apache.hadoop.hbase.master.HMaster.
RegionServer日志
KeeperErrorCode = ConnectionLoss for /hbase/rs/duan140,60020,1544664980603
原因为Master创建baseZNode失败,导致Master和RegionServer挂机。
解决办法:
(1)忘记开放端口,首先测试环境先把防火墙关了,后续再补齐端口开发策略。
3. Failed to identify the fs of dir hdfs://duan139:8020/hbase/lib, ignored
java.io.IOException: No FileSystem for scheme: hdfs
解决办法:
需要在hadoop的core-site.xml中加入如下配置:
<property>
<name>fs.hdfs.impl</name>
<value>org.apache.hadoop.hdfs.DistributedFileSystem</value>
<description>The FileSystem for hdfs: uris.</description>
</property>
详细参考:https://blog.csdn.net/yhao2014/article/details/45575325
4. java.lang.reflect.InvocationTargetException
由问题三引申出来的,工程中缺少了org.apache.hadoop.hdfs.DistributedFileSystem包。添加hadoop-hdfs-2.6.0-cdh5.12.2.jar ,仍然报错。故删除此配置。