基于hadoop-3.3.2安装hbase-2.4.11,报错:object is not an instance of declaring class(已处理)

基于hadoop-3.3.2安装hbase-2.4.11,报错:object is not an instance of declaring class

  • 安装之前看了hbase官网,hbase-2.4.11和hadoop-3.3.2是不冲突的,适配了,于是选择了这两个版本来进行使用;但是无奈还是碰到了问题,一开始以为是不兼容的问题;后面查了资料;原来是因为hbase和Hadoop有冲突包;
  • question:
2022-05-16 21:15:56,450 WARN  [RS-EventLoopGroup-1-2] concurrent.DefaultPromise: An exception was thrown by org.apache.hadoop.hbase.io.asyncfs.FanOutOneBlockAsyncDFSOutputHelper$4.opera
tionComplete()
java.lang.IllegalArgumentException: object is not an instance of declaring class
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.apache.hadoop.hbase.io.asyncfs.ProtobufDecoder.<init>(ProtobufDecoder.java:69)
        at org.apache.hadoop.hbase.io.asyncfs.FanOutOneBlockAsyncDFSOutputHelper.processWriteBlockResponse(FanOutOneBlockAsyncDFSOutputHelper.java:343)
        at org.apache.hadoop.hbase.io.asyncfs.FanOutOneBlockAsyncDFSOutputHelper.access$100(FanOutOneBlockAsyncDFSOutputHelper.java:112)
        at org.apache.hadoop.hbase.io.asyncfs.FanOutOneBlockAsyncDFSOutputHelper$4.operationComplete(FanOutOneBlockAsyncDFSOutputHelper.java:425)
        at org.apache.hbase.thirdparty.io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:578)
        at org.apache.hbase.thirdparty.io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:552)
        at org.apache.hbase.thirdparty.io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:491)
        at org.apache.hbase.thirdparty.io.netty.util.concurrent.DefaultPromise.addListener(DefaultPromise.java:184)
        at org.apache.hadoop.hbase.io.asyncfs.FanOutOneBlockAsyncDFSOutputHelper.initialize(FanOutOneBlockAsyncDFSOutputHelper.java:419)
        at org.apache.hadoop.hbase.io.asyncfs.FanOutOneBlockAsyncDFSOutputHelper.access$300(FanOutOneBlockAsyncDFSOutputHelper.java:112)
        at org.apache.hadoop.hbase.io.asyncfs.FanOutOneBlockAsyncDFSOutputHelper$5.operationComplete(FanOutOneBlockAsyncDFSOutputHelper.java:477)
        at org.apache.hadoop.hbase.io.asyncfs.FanOutOneBlockAsyncDFSOutputHelper$5.operationComplete(FanOutOneBlockAsyncDFSOutputHelper.java:472)
        at org.apache.hbase.thirdparty.io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:578)
        at org.apache.hbase.thirdparty.io.netty.util.concurrent.DefaultPromise.notifyListeners0(DefaultPromise.java:571)
        at org.apache.hbase.thirdparty.io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:550)
        at org.apache.hbase.thirdparty.io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:491)
        at org.apache.hbase.thirdparty.io.netty.util.concurrent.DefaultPromise.setValue0(DefaultPromise.java:616)
        at org.apache.hbase.thirdparty.io.netty.util.concurrent.DefaultPromise.setSuccess0(DefaultPromise.java:605)
        at org.apache.hbase.thirdparty.io.netty.util.concurrent.DefaultPromise.trySuccess(DefaultPromise.java:104)
        at org.apache.hbase.thirdparty.io.netty.channel.DefaultChannelPromise.trySuccess(DefaultChannelPromise.java:84)
        at org.apache.hbase.thirdparty.io.netty.channel.epoll.AbstractEpollChannel$AbstractEpollUnsafe.fulfillConnectPromise(AbstractEpollChannel.java:653)
        at org.apache.hbase.thirdparty.io.netty.channel.epoll.AbstractEpollChannel$AbstractEpollUnsafe.finishConnect(AbstractEpollChannel.java:691)
        at org.apache.hbase.thirdparty.io.netty.channel.epoll.AbstractEpollChannel$AbstractEpollUnsafe.epollOutReady(AbstractEpollChannel.java:567)
        at org.apache.hbase.thirdparty.io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:470)
        at org.apache.hbase.thirdparty.io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:378)
        at org.apache.hbase.thirdparty.io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
        at org.apache.hbase.thirdparty.io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
        at org.apache.hbase.thirdparty.io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
        at java.lang.Thread.run(Thread.java:748)

  • solve
  1. 备份hbase的jar包到安全目录!
[root@only client-facing-thirdparty]# cd before/
[root@only before]# ls
slf4j-api-1.7.33.jar  slf4j-reload4j-1.7.33.jar
  1. 使用Hadoop的jar包替换hbase的jar包; ##注意路径!
[root@only hadoop-3.3.2]# cp share/hadoop/common/lib/slf4j-* /opt/hbase-2.4.11/lib/client-                                                                                               facing-thirdparty/
[root@only hadoop-3.3.2]# pwd
/opt/hadoop-3.3.2
  1. 查看hbase的jar包:(带*为hadoop下的jar包)
[root@only client-facing-thirdparty]# pwd
/opt/hbase-2.4.11/lib/client-facing-thirdparty
[root@only client-facing-thirdparty]# ll
总用量 1940
-rw-r--r--. 1 root root   20437 122 2020 audience-annotations-0.5.0.jar
drwxr-xr-x. 2 root root      67 516 23:01 before
-rw-r--r--. 1 root root   61829 122 2020 commons-logging-1.2.jar
-rw-r--r--. 1 root root 1506370 122 2020 htrace-core4-4.2.0-incubating.jar
-rw-r--r--. 1 root root  334103 122 2020 reload4j-1.2.19.jar
-rw-r--r--. 1 root root   41472 516 23:03 slf4j-api-1.7.30.jar			*
-rw-r--r--. 1 root root   12211 516 23:03 slf4j-log4j12-1.7.30.jar		*
  1. 修改hbase-env.sh内容
打开下面的注释行
export HBASE_DISABLE_HADOOP_CLASSPATH_LOOKUP="true"
  1. 重启hbase
./stop-hbase.sh
./start-hbase.sh
  1. 错误消失,然后执行shell操作:
[root@only conf]# jps
109872 ResourceManager
2305 HRegionServer
14049 Jps
108692 QuorumPeerMain
109081 NameNode
2138 HMaster
109262 DataNode
109566 SecondaryNameNode
110046 NodeManager

shell操作:
[root@only hbase-2.4.11]# hbase shell
2022-05-16 23:05:59,932 WARN  [main] util.NativeCodeLoader: Unable to load native-hadoop l                                                                                               ibrary for your platform... using builtin-java classes where applicable
HBase Shell
Use "help" to get list of supported commands.
Use "exit" to quit this interactive shell.
For Reference, please visit: http://hbase.apache.org/2.0/book.html#shell
Version 2.4.11, r7e672a0da0586e6b7449310815182695bc6ae193, Tue Mar 15 10:31:00 PDT 2022
Took 0.0019 seconds
hbase:001:0> create 'user', 'info', 'data'
Created table user
Took 2.7165 seconds
=> Hbase::Table - user
hbase:002:0> exit;
  • 附上本人的配置文件:
    • hbase-site.xml
<configuration>
<property>
        <name>hbase.zookeeper.quorum</name>
        <value>only:2181</value>
</property>
<property>
        <name>hbase.rootdir</name>
        <value>hdfs://only:9000/hbase</value>
</property>
  <property>
    <name>hbase.cluster.distributed</name>
    <value>true</value>
  </property>
  <property>
    <name>hbase.tmp.dir</name>
    <value>./tmp</value>
  </property>
  <property>
    <name>hbase.unsafe.stream.capability.enforce</name>
    <value>false</value>
  </property>
<property>
        <name>hbase.master.info.port</name>
        <value>60010</value>
 </property>
</configuration>

- hbase-env.sh
export JAVA_HOME=/opt/jdk1.8.0_161
export HBASE_CLASSPATH=$HADOOP_HOME/etc/hadoop
# 不适用内嵌zookeeper
export HBASE_MANAGES_ZK=false
export HBASE_DISABLE_HADOOP_CLASSPATH_LOOKUP="true"

你可能感兴趣的:(hadoop,hbase,hbase,hadoop,big,data)