HBase错误总结

1、出现版本不一致错误
如果启动时出现版本不一致的错误,如下所示:
Server IPC version 10 cannot communicate with client version.........
为了兼容Hadoop-2.2.0,需要将hbase的lib包中的内容lib包中的hadoop-common-2.1.0-beta.jar替换成hadoop-2.2.0/share/hadoop/common目录下的hadoop-common-2.2.0.jar。
2、HBase集群启动以后,执行相关操作时抛出异常
如果HBase集群正常启动,但是在想要创建一个table的时候,出现如下异常,如下所示:
ERROR: org.apache.hadoop.hbase.NotAllMetaRegionsOnlineException: org.apache.hadoop.hbase.NotAllMetaRegionsOnlineException: Timed out (10000ms)  
        at org.apache.hadoop.hbase.catalog.CatalogTracker.waitForMeta(CatalogTracker.java:334)  
        at org.apache.hadoop.hbase.master.HMaster.createTable(HMaster.java:769)  
        at org.apache.hadoop.hbase.master.HMaster.createTable(HMaster.java:743)  
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)  
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)  
        at java.lang.reflect.Method.invoke(Method.java:597)  
        at org.apache.hadoop.hbase.ipc.HBaseRPC$Server.call(HBaseRPC.java:570)  
        at org.apache.hadoop.hbase.ipc.HBaseServer$Handler.run(HBaseServer.java:1039)  
解决方法就是,修改/etc/hosts文件,修改内容以master为例,如下所示:
#127.0.0.1       localhost  
192.168.1.108   master  
192.168.1.110   node  
192.168.0.111   slave  
# The following lines are desirable for IPv6 capable hosts  
#::1     ip6-localhost ip6-loopback  
#fe00::0 ip6-localnet  
#ff00::0 ip6-mcastprefix  
#ff02::1 ip6-allnodes  

#ff02::2 ip6-allrouters  

3、HBase异常:java.io.IOException: Connection reset by peer
org.apache.hadoop.ipc.HBaseServer: IPC Server listener on 60000: readAndProcess threw exception java.io.IOException: Connection reset by peer. Count of bytes read: 0
java.io.IOException: Connection reset by peer
    at sun.nio.ch.FileDispatcher.read0(Native Method)
    at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:21)
    at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:198)
    at sun.nio.ch.IOUtil.read(IOUtil.java:171)
    at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:243)
    at org.apache.hadoop.hbase.ipc.HBaseServer.channelIO(HBaseServer.java:1389)
    at org.apache.hadoop.hbase.ipc.HBaseServer.channelRead(HBaseServer.java:1359)
    at org.apache.hadoop.hbase.ipc.HBaseServer$Connection.readAndProcess(HBaseServer.java:940)
    at org.apache.hadoop.hbase.ipc.HBaseServer$Listener.doRead(HBaseServer.java:522)
    at org.apache.hadoop.hbase.ipc.HBaseServer$Listener$Reader.run(HBaseServer.java:316)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:662)
hbase客户端每次和regionserver交互的时候,都会在服务器端生成一个租约(Lease),租约的有效期由参数hbase.regionserver.lease.period确定。
当客户端去regionserver取数据的时候,而此时hbase中存得数据量很大并且很多region时,客户端请求的region不在内存中,或是没有被cache命中,就需要从磁盘中加载,如果这时候加载需要的时间超过hbase.regionserver.lease.period所配置的时间,并且客户端没有和 regionserver报告其还活着,那么regionserver就会认为本次租约已经过期,并从LeaseQueue从删除掉本次租约,当regionserver加载完成后,拿已经被删除的租约再去取数据的时候,就会出现如上的错误现象。
解决的办法:
1、适当的增大 hbase.regionserver.lease.period参数的值,默认是1分钟
2、增大regionserver的cache大小

4、HBase开启thrift异常: java.lang.ClassNotFoundException: org.apache.hadoop.util.PlatformName

Exception in thread "Thread-3" java.lang.NoClassDefFoundError: org/apache/hadoop/util/PlatformName
        at org.apache.hadoop.security.UserGroupInformation.getOSLoginModuleName(UserGroupInformation.java:303)
        at org.apache.hadoop.security.UserGroupInformation.(UserGroupInformation.java:348)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.hadoop.hbase.util.Methods.call(Methods.java:39)
        at org.apache.hadoop.hbase.security.User.call(User.java:414)
        at org.apache.hadoop.hbase.security.User.callStatic(User.java:404)
        at org.apache.hadoop.hbase.security.User.access$200(User.java:48)
        at org.apache.hadoop.hbase.security.User$SecureHadoopUser.(User.java:221)
        at org.apache.hadoop.hbase.security.User$SecureHadoopUser.(User.java:216)
        at org.apache.hadoop.hbase.security.User.getCurrent(User.java:139)
        at org.apache.hadoop.hbase.client.HConnectionKey.(HConnectionKey.java:67)
        at org.apache.hadoop.hbase.client.HConnectionManager.getConnection(HConnectionManager.java:240)
        at org.apache.hadoop.hbase.client.HTable.(HTable.java:187)
        at org.apache.hadoop.hbase.client.HTable.(HTable.java:149)
        at com.yahoo.ycsb.db.HBaseClient.getHTable(HBaseClient.java:118)
        at com.yahoo.ycsb.db.HBaseClient.update(HBaseClient.java:303)
        at com.yahoo.ycsb.db.HBaseClient.insert(HBaseClient.java:358)
        at com.yahoo.ycsb.DBWrapper.insert(DBWrapper.java:148)
        at com.yahoo.ycsb.workloads.CoreWorkload.doInsert(CoreWorkload.java:461)
        at com.yahoo.ycsb.ClientThread.run(Client.java:269)
Caused by: java.lang.ClassNotFoundException: org.apache.hadoop.util.PlatformName
        at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:247)

解决办法:使用hadoop-auth-2.2.0.jar替换hbase安装目录下的hadoop-auth-2.1.0-beta.jar

5、创建HMaster对象时报告60000 : Address already in use

创建HMaster对象时报告Problem binding to hbase1/192.168.0.1:60000 : Address already in use,这是因为有另外一个程序占用了默认的60000端口,这时,需要

Configuration configuration = new Configuration();
configuration.set(HConstants.ZOOKEEPER_CLIENT_PORT, "2181"));
configuration.set(HConstants.ZOOKEEPER_QUORUM, "192.168.0.1,192.168.0.2,192.168.0.3");
configuration.set(HConstants.MASTER_PORT, "60001");

conf = HBaseConfiguration.create(configuration);
master = new HMaster(conf);
将默认的60000端口重新设置成新的端口,比如60001。

转载请注明出处:http://blog.csdn.net/iAm333

你可能感兴趣的:(HBase,HBase学习笔记)