Support Questions
Find answers, ask questions, and share your expertise

hive install and configuration

Explorer

Hi Team,

I am trying to get Hive running on standalone Hadoop Cluster (manual install not Ambari). Hadoop is installed fine and when I do jps I can see the namenode, datanode, nodemanager, resourcemanager, secondarynamenode all running and I can connect using localhost:50070 & localhost:8088.

Hadoop version is 1.0.3 (HDP 2.7.2)

I have hive version 1.2.1 and am trying to run hive. I get

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:278) at org.apache.hadoop.util.RunJar.run(RunJar.java:214) at org.apache.hadoop.util.RunJar.main(RunJar.java:136) Caused by: java.lang.ClassNotFoundException: org.apache.hadoop.hive.ql.CommandNeedRetryException at java.net.URLClassLoader$1.run(URLClassLoader.java:366) at java.net.URLClassLoader$1.run(URLClassLoader.java:355) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:354) at java.lang.ClassLoader.loadClass(ClassLoader.java:425) at java.lang.ClassLoader.loadClass(ClassLoader.java:358) ... 4 more

I have added the in Hadoop-env.sh the

export HADOOP_CLASSPATH=${HBASE_LIBS}:${HBASE_CONF}:/usr/local/hadoop/hive/lib/*.jar:${HADOOP_CLASSPATH}

(tried combination of having ${HADOOP_CLASSPATH} at beginning. Tried /hive/lib/*.jar with /hive/lib/*.Also, tried adding individual .jar files /usr/local/hadoop/hive/lib/hive-common-1.2.1.jar:/usr/local/hadoop/hive/lib/hive-cli-1.2.1.jar:/usr/local/hadoop/hive/lib/hive-exec-1.2.1.jar:/usr/local/hadoop/hive/lib/hive-service-1.2.1.jar:/usr/local/hadoop/hive/lib/jline-2.12.jar

but still I get the error. I read on forums that its mainly to do with HADOOP CLASSPATH.

Any help/suggestions appreciated.

Regards

Anil Khiani

2 REPLIES 2

You shouldn't need Hive libs in Hadoop classpath. Here are a few examples of setting HIVE_HOME and other variables.

http://www.tutorialspoint.com/hive/hive_installation.htm

https://cwiki.apache.org/confluence/display/Hive/HiveServer2+Clients

http://stackoverflow.com/questions/13333519/error-starting-hive-java-lang-noclassdeffounderror-org-a...

You can see the configurations used in an automated install by downloading the client configs from a Hortonworks HDP Sandbox VM and by starting Hive and viewing the information dialog in Ambari.

cheers,

Andrew

Explorer

Thanks Andrew. Much helpful.