我在启动hive的时候,输入qqbian@ubuntu:/usr/local/apache-hive-2.1.0-bin$ bin/hive
出现了如下问题:
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/hadoop/hive/ql/CommandNeedRetryException
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at org.apache.hadoop.util.RunJar.run(RunJar.java:219)
at org.apache.hadoop.util.RunJar.main(RunJar.java:141)
Caused by: java.lang.ClassNotFoundException: org.apache.hadoop.hive.ql.CommandNeedRetryException
at java.net.URLClassLoader.findClass(URLClassLoader.java:387)
at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:355)
at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
4 more
根据相关网友的解答,是在hadoop-env.sh文件中配制
HADOOP_CLASSPATH=$HADOOP_CLASSPATH:hadoop的路径;
并把hive的lib/下所有hive-*的包都拷贝到hadoop的lib/中。
我照做后,再次启动hive:qqbian@ubuntu:/usr/local/apache-hive-2.1.0-bin$ bin/hive
又出现了如下问题,请各位友友赐教!
急等
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/hadoop/hive/ql/session/SessionState
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at org.apache.hadoop.util.RunJar.run(RunJar.java:219)
at org.apache.hadoop.util.RunJar.main(RunJar.java:141)
Caused by: java.lang.ClassNotFoundException: org.apache.hadoop.hive.ql.session.SessionState
at java.net.URLClassLoader.findClass(URLClassLoader.java:387)
at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:355)
at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
4 more