分布式部署HBase的那些坑
hadoop 3.3.0
jdk 8
HBase 2.4.2
均为部署时的最新版本
系统为ubuntu18.04,一台master两台slave
hadoop分布式部署,web监视端口9870,HBase分布式部署 ,web监视端口16010,使用自带zookeeper,不额外安装
参考此篇
在部署好HBase使用时遇到以下几个问题:
Server is not running yet
首先启动HBase服务,
start-hbase.sh
启动hbase后,进入shell,
hbase shell
在shell下,使用list命令测试,显示
org.apache.hadoop.hbase.ipc.ServerNotRunningYetException: Server is not running yet
网上大部分的解决方式都是让hadoop退出安全模式,使用
hdfs dfsadmin -safemode get
查询,显示SAFEMODE IS OFF
,说明并不是安全模式的问题。
参考这篇博客解决,删除安装目录/lib/client-facing-thirdparty下的slf4j-log4j12-1.7.30.jar
slf4j-log4j12是链接slf4j-api和log4j中间的适配器:它实现了slf4j-api中StaticLoggerBinder接口,从而使得在编译时绑定的是slf4j-log4j12的getSingleton()方法。参考来源
重新启动HBase服务时会产生几个failed,启动后,进入shell使用list命令测试,一切正常。
org.apache.hadoop.hbase.PleaseHoldException: Master is initializing
在shell下使用list命令测试正常,但当使用create命令插入时,出现
org.apache.hadoop.hbase.PleaseHoldException: Master is initializing
报错,原因是参考其他博客配置分布式环境时,在hbase-site.xml中,注释掉了hbase.zookeeper.property.dataDir一项,造成没有zookeeper目录。若按照上面提到的博客部署,此问题可避免。
HBase停不掉
启动后,使用stop-hbase.sh无限点点点,无法停止服务。参考多篇博客,使用
hbase-daemon.sh stop regionserver
hbase-daemon.sh stop master
首先停掉两个服务后,再使用stop-hbase.sh即可顺利关闭服务。