蜂巢壳无法启动 [英] hive shell not starting

查看:117
本文介绍了蜂巢壳无法启动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

    hadoop_1@shubho-HP-Notebook:~$ hive
    SLF4J: Class path contains multiple SLF4J bindings.
    SLF4J: Found binding in [jar:file:/home/hadoop_1/apache-hive-2.3.2-bin/lib           /log4j-slf4j-impl-2.6.2.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/hadoop_1/hadoop/share/hadoop/common       /lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
Exception in thread "main" java.lang.ClassCastException: java.base/jdk.internal.loader.ClassLoaders$AppClassLoader cannot be cast to java.base/java.net.URLClassLoader
    at org.apache.hadoop.hive.ql.session.SessionState.<init>(SessionState.java:394)
    at org.apache.hadoop.hive.ql.session.SessionState.<init>(SessionState.java:370)
    at org.apache.hadoop.hive.cli.CliSessionState.<init>(CliSessionState.java:60)
    at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:708)
    at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:686)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:564)
    at org.apache.hadoop.util.RunJar.run(RunJar.java:221)
    at org.apache.hadoop.util.RunJar.main(RunJar.java:136)
hadoop_1@shubho-HP-Notebook:~$

引发了以上异常.所以我检查了一下,没有conf/hive-site.xml.所以我创建并编辑了它:

The above Exception was thrown. So I checked and there was no conf/hive-site.xml. So I created and edited it:

<property>
  <name>hive.exec.local.scratchdir</name>
    <value>$HIVE_HOME/iotmp</value>
    <description>Local scratch space for Hive jobs</description>
</property>
<property>
   <name>hive.querylog.location</name>
    <value>$HIVE_HOME/iotmp</value>
    <description>Location of Hive run time structured log file</description>
 </property>
 <property>
   <name>hive.downloaded.resources.dir</name>
    <value>$HIVE_HOME/iotmp</value>
    <description>Temporary local directory for added resources in the remote file system.</description>
 </property>

仍然会引发相同的错误.

Still the same error is thrown.

推荐答案

我正在努力解决同一错误.我发现问题是由于我安装了Java 9并用Java 9配置了hadoop而引起的,而Hive不支持Java 9版.

I was struggling with the same error. I found that the problem was caused because I installed java 9 and configured hadoop with java 9. While Hive does not support java version 9.

解决方案是将Java版本9替换为Java版本8.安装Java版本8,然后在Java 8上同时配置hadoop和hive.

The solution is to replace java version 9 with java version 8.Install java version 8 and then configure both hadoop and hive on java 8.

打开文件$HADOOP_HOME/etc/hadoop/hadoop-env.sh并粘贴以下行:

Open file $HADOOP_HOME/etc/hadoop/hadoop-env.sh and paste the below line:

export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64

在配置配置单元时还要设置相同的地址.

also set the same address while configuring hive.

这篇关于蜂巢壳无法启动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆