zeppelin hive interpreter throws ClassNotFoundException

匿名 (未验证) 提交于 2019-12-03 01:20:02

问题:

I have deployed zeppelin 0.6 and configured hive under Jdbc interpreter.

Tried executing

%hive      show databases 

Throws:

org.apache.hive.jdbc.HiveDriver class java.lang.ClassNotFoundException java.net.URLClassLoader.findClass(URLClassLoader.java:381) java.lang.ClassLoader.loadClass(ClassLoader.java:424) sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) java.lang.ClassLoader.loadClass(ClassLoader.java:357) java.lang.Class.forName0(Native Method) java.lang.Class.forName(Class.java:264) org.apache.zeppelin.jdbc.JDBCInterpreter.getConnection(JDBCInterpreter.java:220) org.apache.zeppelin.jdbc.JDBCInterpreter.getStatement(JDBCInterpreter.java:233) org.apache.zeppelin.jdbc.JDBCInterpreter.executeSql(JDBCInterpreter.java:292) org.apache.zeppelin.jdbc.JDBCInterpreter.interpret(JDBCInterpreter.java:398) org.apache.zeppelin.interpreter.LazyOpenInterpreter.interpret(LazyOpenInterpreter.java:94) org.apache.zeppelin.interpreter.remote.RemoteInterpreterServer$InterpretJob.jobRun(RemoteInterpreterServer.java:383) org.apache.zeppelin.scheduler.Job.run(Job.java:176) org.apache.zeppelin.scheduler.ParallelScheduler$JobRunner.run(ParallelScheduler.java:162) java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) java.util.concurrent.FutureTask.run(FutureTask.java:266) java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) java.lang.Thread.run(Thread.java:745)

回答1:

I just ran into this issue this morning. I'm not sure if this is the recommended way to fix, but I downloaded the binary packages for Hive 1.2, and Hadoop 2.6.4. I then copied the following jars to ./interpreter/jdbc/ and reloaded zeppelin ./bin/zeppelin-daemon.sh reload

cp ~/Dev/Hadoop/apache-hive-1.2.1-bin/lib/hive-jdbc-1.2.1-standalone.jar ./interpreter/jdbc/

cp ~/Dev/Hadoop/hadoop-2.6.4/share/hadoop/common/hadoop-common-2.6.4.jar ./interpreter/jdbc/



回答2:

1) You could download just Hive JDBC driver instead of whole Hive jars set, for example, one from Cloudera:

http://www.cloudera.com/downloads/connectors/hive/jdbc/2-5-17.html

2)

Hive starting with 0.14 will have a standalone jar for JDBC part:

hive-jdbc-standalone.jar

but until https://issues.apache.org/jira/browse/HIVE-9600 is resolved, you would need two more jars:

hadoop-common.jar

hadoop-auth.jar

to put into classpath along with hive-jdbc-standalone.jar



回答3:

The top rated answer given here fixes the issue

However I have added the classpath of HADOOP_HOME to interpreter.sh to take the jar files in common

Below is the line which I have added to bin/interpreter.sh inside zeppelin

HADOOP_HOME=/opt/hadoop-2.6.2/ addJarInDirForIntp "${HADOOP_HOME}/share/hadoop/common 


易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!