无法从 hbase 提供 hive 中的表

问题描述

在 HDP 3.1.x 上,我使用 STORED BY org.apache.hadoop.hive.hbase.HBaseStorageHandler 选项创建了一个链接到 Hbase 的表。 执行选择时,它工作正常。 当我尝试从中填充表格时,它因错误而崩溃

create table test as select * from hbase_xxx;

INFO  : Completed executing command(queryId=hive_20210205161427_a49ca7bc-0637-4c19-9a62-6657376373a1); Time taken: 74.951 seconds

Error: Error while processing statement: Failed: Execution Error,return code 2 from org.apache.hadoop.hive.ql.exec.tez.TezTask. 
Vertex Failed,vertexName=Map 1,vertexId=vertex_1611574680060_3923_1_00,diagnostics=[Vertex vertex_1611574680060_3923_1_00 [Map 1] killed/Failed due to:ROOT_INPUT_INIT_FAILURE,Vertex Input: raw_eff_ann_ent initializer Failed,vertex=vertex_1611574680060_3923_1_00 [Map 1],org.apache.hadoop.hbase.client.RetriesExhaustedException: Can't get the location for replica 0

当查看 YARN 日志时,它似乎尝试从带有 localhost:2181 的数据节点连接到 zookeeper ...但失败了

2021-02-05 11:22:41,921 [WARN] [ReadOnlyZKClient-localhost:2181@0x48730f2c] |zookeeper.ReadOnlyZKClient|: 0x48730f2c to localhost:2181 Failed for get of /hbase/hbaseid,code = CONNECTIONLOSS,retries = 1

选择相同的日志显示zookeeper_quorum连接字符串到zookeeper并成功

有什么想法吗?

解决方法

我从支持中得到了回报;你必须强制 hbase-site.xml 进入 hive env 的模板 这就是解决方案

    Add the below:
export HIVE_AUX_JARS_PATH=${HIVE_AUX_JARS_PATH}:/etc/hbase/conf/hbase-site.xml 
to your Advanced hive-env->hive-env template,before this statement export METASTORE_PORT={{hive_metastore_port}}