HBase安装过程中遇到的问题

1、HRegionServer启动不正常

在namenode上执行jps,则可看到hbase启动是否正常,进程如下:
[root@bigdata120 ~]# jps
26341 HMaster
26642 Jps
7524 NameNode
7974 NodeManager
7521 DataNode
7974 NodeManager
7703 SecondaryNameNode
7870 ResourceManager
由上可见,hadoop启动正常。HBase少了一个进程,猜测应该是有个节点regionserver没有启动成功。
进入节点slave1 ,执行jps查看启动进程:
[root@master bin]# ssh slave1
Last login: Thu Jul 17 17:29:11 2014 from master
[root@slave1 ~]# jps
4296 DataNode
11261 HRegionServer
11512 Jps
11184 QuorumPeerMain
由此可见Slave1节点正常。
进入节点slave2节点,执行jps查看启动进程:
[root@slave2 ~]# jps
3795 DataNode
11339 Jps
11080 QuorumPeerMain
OK,问题找到了 HRegionServer没有启动成功。进入HBase日志:
2014-07-17 09:28:19,392 INFO [regionserver60020] regionserver.HRegionServer: STOPPED: Unhandled: org.apache.hadoop.hbase.ClockOutOfSyncException: Server slave2,60020,1405560498057 has been rejected; Reported time is too far out of sync with master. Time difference of 28804194ms > max allowed of 30000ms
at org.apache.hadoop.hbase.master.ServerManager.checkClockSkew(ServerManager.java:314)
at org.apache.hadoop.hbase.master.ServerManager.regionServerStartup(ServerManager.java:215)
at org.apache.hadoop.hbase.master.HMaster.regionServerStartup(HMaster.java:1292)
at org.apache.hadoop.hbase.protobuf.generated.RegionServerStatusProtos$RegionServerStatusService 2. c a l l B l o c k i n g M e t h o d ( R e g i o n S e r v e r S t a t u s P r o t o s . j a v a : 5085 ) a t o r g . a p a c h e . h a d o o p . h b a s e . i p c . R p c S e r v e r . c a l l ( R p c S e r v e r . j a v a : 2185 ) a t o r g . a p a c h e . h a d o o p . h b a s e . i p c . R p c S e r v e r 2.callBlockingMethod(RegionServerStatusProtos.java:5085) at org.apache.hadoop.hbase.ipc.RpcServer.call(RpcServer.java:2185) at org.apache.hadoop.hbase.ipc.RpcServer 2.callBlockingMethod(RegionServerStatusProtos.java:5085)atorg.apache.hadoop.hbase.ipc.RpcServer.call(RpcServer.java:2185)atorg.apache.hadoop.hbase.ipc.RpcServerHandler.run(RpcServer.java:1889)
根据错误日志,可得到slave2和maste机器时间差太多,查看各个系统的时间,果真如此,同步即可。另外一种方法就是配置hbase的配置文件:
配置:hbase.master.maxclockske

hbase.master.maxclockskew
200000
Time difference of regionserver from master

(这种方法不推荐)

2、Zookeeper启动不正常。

在启动hbase时,总是报错,提示zookeeper连接不上,查看zookeeper日志,发现:
  ClientCnxn$SendThread@966] - Opening socket connection to server slave1. Will not attempt to authenticate using SASL (无法定位登录配置)。经过百度可得
由于hosts文件的问题,于是vi /etc/hosts 发现 ip slave1配置中ip错误。汗!幸亏hbase和zookeeper都有日志。于是重启zookeeper和hbase,上述问题解决。

3、HBase shell执行list命令报错。

在Hbase shell执行list命令报错:
View Code
关键错误信息:client.HConnectionManager$HConnectionImplementation: Can’t get connection to ZooKeeper: KeeperErrorCode = ConnectionLoss for /hbase。根据信息可以判断zk无法连接。执行jps查看zk都正常。查看hbase-site.xml中zk节点配置正常。根据经验,应该是防火墙没有关闭,2181端口无法访问。ok执行service iptables stop关闭防火墙,重启hbase。进入hbase shell,执行list:
hbase(main):001:0> list
TABLE
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/root/hadoop/hbase/lib/slf4j-log4j12-1.6.4.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/root/hadoop/hadoop-2.2.0/share/hadoop/common/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
2014-07-17 14:06:26,013 WARN [main] util.NativeCodeLoader: Unable to load native-hadoop library for your platform… using builtin-java classes where applicable
0 row(s) in 1.0070 seconds
=> []
一切正常,问题解决。

4、HBase Shell 增删改异常。

在hbase shell上做增删改就会报异常,
zookeeper.ClientCnxn: Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect。
经判断是hbase版本的jar包和hadoop中的jar包不兼容的问题。解决方法:将hadoop中hadoop-2.2.0相关的jar包copy过来(${HABASE_HOME}/lib)替换即可。

5、启动hbase报错,master running as process 10816. Stop it first.

./bin目录下的文件
HBase安装过程中遇到的问题_第1张图片
先使用脚本stop-hbse.sh,停止hbase;[root@localhost bin]# ./stop-hbase.shstopping hbase…使用命令脚本start-hbase.sh启动;[root@localhost bin]# ./start-hbase.shstarting master, logging to /data/hbase/alihbase-1.1.4/bin/…/logs/hbase-root-master-localhost.localdomain.out成功启动后,进入hbase,测试是否正常使用:[root@localhost bin]# ./hbase shell2018-04-11 18:47:52,734 WARN [main] util.NativeCodeLoader: Unable to load native-hadoop library for your platform… using builtin-java classes where applicableHBase Shell; enter ‘help’ for list of supported commands.Type “exit” to leave the HBase ShellVersion 1.1.4, r42087c14e8a7c40a7b027b54e00271bf1e3c1d26, Wed Mar 21 20:59:02 CST 2018hbase(main):001:0>

你可能感兴趣的:(HBase安装过程中遇到的问题)