
[英]Hbase java.lang.NoClassDefFoundError: org/apache/hadoop/hbase/MasterNotRunningException
[英]Create Hive table with Phoenix handler throws NoClassDefFoundError: org.apache.hadoop.hbase.security.SecurityInfo
我想在 emr 的 phoenix 表上创建 hive 表。
我正面临NoClassDefFoundError: org.apache.hadoop.hbase.security.SecurityInfo
到目前为止我做了什么:
I followed the instructions from https://phoenix.apache.org/hive_storage_handler.html and added phoenix-hive-5.0.0-HBase-2.0.jar
to hive-env.sh
as well as in hive-site.xml
.
重启了 hive 服务systemctl restart hive-server2.service
重新启动元存储系统ctl systemctl restart hive-hcatalog-server.service
从 hue 执行创建表命令:
create external table ext_table (
i1 int,
s1 string,
f1 float,
d1 decimal
)
STORED BY 'org.apache.phoenix.hive.PhoenixStorageHandler'
TBLPROPERTIES (
"phoenix.table.name" = "ext_table",
"phoenix.zookeeper.quorum" = "localhost",
"phoenix.zookeeper.znode.parent" = "/hbase",
"phoenix.zookeeper.client.port" = "2181",
"phoenix.rowkeys" = "i1",
"phoenix.column.mapping" = "i1:i1, s1:s1, f1:f1, d1:d1"
);
出现异常: Error while processing statement: FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. MetaException(message:java.lang.NoClassDefFoundError: Could not initialize class org.apache.hadoop.hbase.security.SecurityInfo)
Error while processing statement: FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. MetaException(message:java.lang.NoClassDefFoundError: Could not initialize class org.apache.hadoop.hbase.security.SecurityInfo)
我正在使用 emr-6.1.0
HBase 2.2.5
凤凰5.0.0
Hive 3.1.2
有人知道可能是什么问题吗?
我遵循了@leftjoin 的建议,并使用了色调中的ADD JAR
将 phoenix-hive jar 添加到类路径中。 然后我遇到了由我使用的 phoenix hive 连接器引起的 jar 兼容性问题: phoenix-hive-5.0.0-HBase-2.0.jar
较新版本的 phoenix 连接器未归档到可以从phoenix 网站下载的单个捆绑包中。 相反,连接器现在位于github repo中。
我构建了新的 phoenix-hive 连接器(版本:Phoenix->5.1.0、Hive->3.1.2、Hbase->2.2)并用它来创建 Hive 表。
结果我得到了另一个异常,我无法修复:
FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. org/apache/phoenix/compat/hbase/CompatSteppingSplitPolicy
我认为它仍然与依赖问题有关。 但不知道究竟是什么。
作为一种解决方法,将 jar 放入 hdfs 并在创建表和查询之前执行ADD JAR
命令:
ADD JAR hdfs://path/to/your/jar/phoenix-hive-5.0.0-HBase-2.0.jar;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.