Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Who agreed with this topic

problem running query through webhcat - CDH 5

Champion Alumni

Hello,

 

I need to expose a simple webservice (get only the lines that have a certain ID from one table). Therefore I tried to use WebHCat. 

curl -v -d user.name=agherman -d execute="SELECT * FROM myDatabase.myTable+*+WHERE+key=52;" -d statusdir="/user/agherman/agherman.output" 'http://<ip>:50111/templeton/v1/hive'

 Firstly I had a similar error with this post : http://community.cloudera.com/t5/Batch-SQL-Apache-Hive/problem-running-hive-query-through-webhcat/td... , therefore I folowed the given steps (and I addaped them to CDH5 version). 

 

  • ln -s ../../../../../../jars/hive-exec-0.13.1-cdh5.3.0.jar /opt/cloudera/parcels/CDH-5.3.0-1.cdh5.3.0.p0.30/lib/hive-hcatalog/sbin/../share/webhcat/svr/lib/

  • Service-Wide Environment Safety Valve (Cloudera Management Service Environment Advanced Configuration Snippet (Safety Valve)): TEMPLETON_HOME=/opt/cloudera/parcels/CDH/lib/hive-hcatalog

  • WebHCat Server Configuration Safety Valve for webhcat-site.xml

<property>
    <name>templeton.libjars</name>
    <value>${env.TEMPLETON_HOME}/share/webhcat/svr/lib/zookeeper-3.4.5-cdh5.3.0.jar</value>
    <description>Jars to add to the classpath.</description>
  </property>
<property>
    <name>templeton.hive.path</name>
    <value>hive-0.13.1-cdh5.3.0.tar.gz/hive/bin/hive</value>
    <description>The path to the Hive executable.</description>
  </property>
  
  <property>
    <name>templeton.hive.archive</name>
    <value>hdfs:///apps/templeton/hive-0.13.1-cdh5.3.0.tar.gz</value>
    <description>The path to the Hive executable.</description>
  </property>
  •  Create tar an upload
cd /opt/cloudera/parcels/CDH/lib
tar -zcvf /tmp/hive-0.13.1-cdh5.3.0.tar.gz ./
cd /tmp
sudo -u hdfs hadoop fs -mkdir /apps/templeton
sudo -u hdfs hadoop fs -mkdir /apps
sudo -u hdfs hadoop fs -mkdir /apps/templeton
sudo -u hdfs hadoop fs -put /tmp/hive-0.13.0-cdh5.3.0.tar.gz /apps/templeton
sudo -u hdfs hadoop dfs -chmod -R 777 /apps/templeton
 
  • create needed directory

 

hdfs dfs -mkdir /templeton-hadoop

hdfs dfs -mkdir /templeton-hadoop/jobs/

hdfs dfs -chown -R hive /templeton-hadoop

 

  • However now, the jobs run and has a sucessful state but when I try to see my result file I have a missing jar error:
-	Missing Hive Execution Jar: /yarn/nm/usercache/agherman/appcache/application_1422872444323_0062/container_1422872444323_0062_01_000002/hive-0.13.1-cdh5.3.0.tar.gz/hive/lib/hive-exec-*.jar => add this jar into our jar

 I checked the created hive-0.13.1-cdh5.3.0.tar.gz and it contains 2 hive-exec-*.jar in the hive/lib directory...

 

What should I check? Where should I add this jars?

 

Thank you!

 

 

GHERMAN Alina
Who agreed with this topic