HBase和Hive整合后,在Hive shell中执行建表语句时错误信息如下:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
14/03/28 16:41:59 ERROR exec.DDLTask: org.apache.hadoop.hive.ql.metadata.HiveException: java.lang.IllegalArgumentException: Not a host:port pair: PBUF Master.Hadoop��ظ�( at org.apache.hadoop.hive.ql.metadata.Hive.createTable(Hive.java:602) at org.apache.hadoop.hive.ql.exec.DDLTask.createTable(DDLTask.java:3661) at org.apache.hadoop.hive.ql.exec.DDLTask.execute(DDLTask.java:252) at org.apache.hadoop.hive.ql.exec.Task.executeTask(Task.java:151) at org.apache.hadoop.hive.ql.exec.TaskRunner.runSequential(TaskRunner.java:65) at org.apache.hadoop.hive.ql.Driver.launchTask(Driver.java:1414) at org.apache.hadoop.hive.ql.Driver.execute(Driver.java:1192) at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1020) at org.apache.hadoop.hive.ql.Driver.run(Driver.java:888) at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:259) at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:216) at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:413) at org.apache.hadoop.hive.cli.CliDriver.executeDriver(CliDriver.java:781) at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:675) at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:614) 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.util.RunJar.main(RunJar.java:212) Caused by: java.lang.IllegalArgumentException: Not a host:port pair: PBUF |
一般这样的错误信息是由于:<HIVE_HOME>/lib/hbase-x.y.z*.jar的版本和当前环境中HBase的版本不一致造成的,只要把hbase-x.y.z*.jar 替换成<HBASE_HOME>/lib/下的相关jar 即可。
以hive-0.12.0 和 HBase 0.98.0为例:
用<HBASE_HOME>/lib/目录下得jar包:
1 2 3 4 5 6 |
hbase-client-0.98.0-hadoop2.jar hbase-common-0.98.0-hadoop2-tests.jar hbase-common-0.98.0-hadoop2.jar hbase-protocol-0.98.0-hadoop2.jar hbase-server-0.98.0-hadoop2.jar htrace-core-2.04.jar |
替换掉<HIVE_HOME>/lib/目录下的jar包:
1 2 |
hbase-0.94.6.1-tests.jar hbase-0.94.6.1.jar |
再执行建表等命令即可成功。
—————– EOF @Michael Sun —————–
hbase版本替换后建表是成功了,但是查表出现异常:
select * from hbase_table_1;
OK
Failed with exception java.io.IOException:java.lang.ClassCastException: org.apache.hadoop.hbase.client.Result cannot be cast to org.apache.hadoop.io.Writable
Time taken: 0.24 seconds
这个是什么问题
能把你 hive hbase 等的版本 贴出给我看看
hadoop-2.2.0+hbase-0.96.2+hive-0.12.0这个组合,也包楼上的错误