<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: How to run oozie shell action for hive queries in kerberos-enabled cluster? in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-run-oozie-shell-action-for-hive-queries-in-kerberos/m-p/137137#M35153</link>
    <description>&lt;P&gt;Thanks for the response &lt;A rel="user" href="https://community.cloudera.com/users/504/kkulkarni.html" nodeid="504"&gt;@Kuldeep Kulkarni&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;I followed the exact same approach you explained in your blog. The only difference was that we had &lt;STRONG&gt;tez&lt;/STRONG&gt; as our execution engine for hive.&lt;/P&gt;&lt;P&gt;Anyhow, I tried this first and it didn't work. It is because I believe that I am changing the execution engine to &lt;STRONG&gt;mr&lt;/STRONG&gt; with in the hive CLI which is late because hive attempts to launch Tez AppMaster when we attempt to launch the CLI itself even before running the query.&lt;/P&gt;&lt;PRE&gt;hive -e "SET hive.execution.engine=mr; SET mapreduce.job.credentials.binary=${HADOOP_TOKEN_FILE_LOCATION}; select MAX(update_time) from test_db.test_table;" -S
&lt;/PRE&gt;&lt;P&gt;Then, I changed my command to include &lt;STRONG&gt;hiveconf &lt;/STRONG&gt;so that I am changing my execution engine to &lt;STRONG&gt;mr&lt;/STRONG&gt; even before Hive attempts to launch the Tez AppMaster. &lt;STRONG&gt;This one worked!!!&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;hive -e "SET mapreduce.job.credentials.binary=${HADOOP_TOKEN_FILE_LOCATION}; select MAX(update_time) from test_db.test_table;" -S --hiveconf hive.execution.engine=mr
&lt;/PRE&gt;&lt;P&gt;I also tried other options as well which are listed below. &lt;STRONG&gt;These didn't work either.&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;hive -e "select MAX(update_time) from test_db.test_table;" -S --hiveconf tez.credentials.path=${HADOOP_TOKEN_FILE_LOCATION} 
&lt;/PRE&gt;&lt;PRE&gt;hive -e "SET tez.credentials.path=${HADOOP_TOKEN_FILE_LOCATION}; select MAX(update_time) from test_db.test_table;" -S
&lt;/PRE&gt;I am curious to understand why passing the credentials to Tez won't work. Are you aware of any existing open apache bug for this? Understanding this better will help me in future.&lt;P&gt;Thanks again.&lt;/P&gt;</description>
    <pubDate>Fri, 29 Jul 2016 23:14:06 GMT</pubDate>
    <dc:creator>gmummineni</dc:creator>
    <dc:date>2016-07-29T23:14:06Z</dc:date>
    <item>
      <title>How to run oozie shell action for hive queries in kerberos-enabled cluster?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-run-oozie-shell-action-for-hive-queries-in-kerberos/m-p/137131#M35147</link>
      <description>&lt;P&gt;Hi, we're kerberizing our HDP cluster. As part of that process, we kerberized our QA cluster and testing all our oozie workflows in kerberos environment. We were able to run java and hive actions successfully, but are stuck with shell actions where we run a hive query inside a shell action. We've tried multiple approaches. But, none of them works. &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;
Here is what we tried: &lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;
&lt;LI&gt;Approach # 1:&lt;/LI&gt;&lt;/UL&gt;&lt;P style="margin-left: 20px;"&gt;Added "credentials" section in our workflow similar to what we do for hive actions. &lt;/P&gt;&lt;UL&gt;
&lt;LI&gt;Approach # 2:&lt;/LI&gt;&lt;/UL&gt;&lt;P style="margin-left: 20px;"&gt;Doing kinit inside the shell script before launching hive CLI. &lt;/P&gt;&lt;P&gt;We get this error for both the approaches: &lt;/P&gt;&lt;PRE&gt;Exception in thread "main" java.lang.RuntimeException: org.apache.hadoop.ipc.RemoteException(java.io.IOException): Delegation Token can be issued only with kerberos or web authentication
at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.getDelegationToken(FSNamesystem.java:6744)
at org.apache.hadoop.hdfs.server.namenode.NameNodeRpcServer.getDelegationToken(NameNodeRpcServer.java:628)
at org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolServerSideTranslatorPB.getDelegationToken(ClientNamenodeProtocolServerSideTranslatorPB.java:987)
at org.apache.hadoop.hdfs.protocol.proto.ClientNamenodeProtocolProtos$ClientNamenodeProtocol$2.callBlockingMethod(ClientNamenodeProtocolProtos.java)
at org.apache.hadoop.ipc.ProtobufRpcEngine$Server$ProtoBufRpcInvoker.call(ProtobufRpcEngine.java:616)
at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:969)
at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:2151)
at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:2147)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:422)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1657)
at org.apache.hadoop.ipc.Server$Handler.run(Server.java:2145)

at org.apache.hadoop.hive.ql.session.SessionState.start(SessionState.java:507)
at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:680)
at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:624)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.apache.hadoop.util.RunJar.run(RunJar.java:221)
at org.apache.hadoop.util.RunJar.main(RunJar.java:136)
Caused by: org.apache.hadoop.ipc.RemoteException(java.io.IOException): Delegation Token can be issued only with kerberos or web authentication
at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.getDelegationToken(FSNamesystem.java:6744)
at org.apache.hadoop.hdfs.server.namenode.NameNodeRpcServer.getDelegationToken(NameNodeRpcServer.java:628)
at org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolServerSideTranslatorPB.getDelegationToken(ClientNamenodeProtocolServerSideTranslatorPB.java:987)
at org.apache.hadoop.hdfs.protocol.proto.ClientNamenodeProtocolProtos$ClientNamenodeProtocol$2.callBlockingMethod(ClientNamenodeProtocolProtos.java)
at org.apache.hadoop.ipc.ProtobufRpcEngine$Server$ProtoBufRpcInvoker.call(ProtobufRpcEngine.java:616)
at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:969)
at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:2151)
at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:2147)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:422)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1657)
at org.apache.hadoop.ipc.Server$Handler.run(Server.java:2145)

at org.apache.hadoop.ipc.Client.call(Client.java:1427)
at org.apache.hadoop.ipc.Client.call(Client.java:1358)
at org.apache.hadoop.ipc.ProtobufRpcEngine$Invoker.invoke(ProtobufRpcEngine.java:229)
at com.sun.proxy.$Proxy14.getDelegationToken(Unknown Source)
at org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolTranslatorPB.getDelegationToken(ClientNamenodeProtocolTranslatorPB.java:933)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.apache.hadoop.io.retry.RetryInvocationHandler.invokeMethod(RetryInvocationHandler.java:252)
at org.apache.hadoop.io.retry.RetryInvocationHandler.invoke(RetryInvocationHandler.java:104)
at com.sun.proxy.$Proxy15.getDelegationToken(Unknown Source)
at org.apache.hadoop.hdfs.DFSClient.getDelegationToken(DFSClient.java:1043)
at org.apache.hadoop.hdfs.DistributedFileSystem.getDelegationToken(DistributedFileSystem.java:1552)
at org.apache.hadoop.fs.FileSystem.collectDelegationTokens(FileSystem.java:530)
at org.apache.hadoop.fs.FileSystem.addDelegationTokens(FileSystem.java:508)
at org.apache.hadoop.hdfs.DistributedFileSystem.addDelegationTokens(DistributedFileSystem.java:2238)
at org.apache.tez.common.security.TokenCache.obtainTokensForFileSystemsInternal(TokenCache.java:107)
at org.apache.tez.common.security.TokenCache.obtainTokensForFileSystemsInternal(TokenCache.java:86)
at org.apache.tez.common.security.TokenCache.obtainTokensForFileSystems(TokenCache.java:76)
at org.apache.tez.client.TezClientUtils.setupTezJarsLocalResources(TezClientUtils.java:200)
at org.apache.tez.client.TezClient.getTezJarResources(TezClient.java:845)
at org.apache.tez.client.TezClient.start(TezClient.java:380)
at org.apache.hadoop.hive.ql.exec.tez.TezSessionState.open(TezSessionState.java:196)
at org.apache.hadoop.hive.ql.exec.tez.TezSessionState.open(TezSessionState.java:117)
at org.apache.hadoop.hive.ql.session.SessionState.start(SessionState.java:504)
... 8 more
&lt;/PRE&gt;&lt;P&gt;Followed this blog &lt;A href="https://prodlife.wordpress.com/2013/11/22/using-oozie-in-kerberized-cluster/"&gt;using-oozie-in-kerberized-cluster&lt;/A&gt;. Please refer to bullet point #7 in this blog.&lt;/P&gt;&lt;P&gt;Please advise. Thanks much.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jul 2016 01:59:03 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-run-oozie-shell-action-for-hive-queries-in-kerberos/m-p/137131#M35147</guid>
      <dc:creator>gmummineni</dc:creator>
      <dc:date>2016-07-20T01:59:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to run oozie shell action for hive queries in kerberos-enabled cluster?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-run-oozie-shell-action-for-hive-queries-in-kerberos/m-p/137132#M35148</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/1486/smanjee.html" nodeid="1486"&gt;@Sunile Manjee&lt;/A&gt; thanks much for your response.&lt;/P&gt;&lt;P&gt;We did try "kinit" inside the shell script. Still got the same error. But, the only difference here is that we do not have keytab on HDFS. We pushed the keytab to all the cluster nodes and it is available on local file system.&lt;/P&gt;&lt;PRE&gt;kinit foo@TEST.COM -k -t /etc/security/keytabs/foo.headless.keytab&lt;/PRE&gt;</description>
      <pubDate>Wed, 20 Jul 2016 02:08:01 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-run-oozie-shell-action-for-hive-queries-in-kerberos/m-p/137132#M35148</guid>
      <dc:creator>gmummineni</dc:creator>
      <dc:date>2016-07-20T02:08:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to run oozie shell action for hive queries in kerberos-enabled cluster?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-run-oozie-shell-action-for-hive-queries-in-kerberos/m-p/137133#M35149</link>
      <description>&lt;P style="margin-left: 80px;"&gt; &lt;A rel="user" href="https://community.cloudera.com/users/11958/gmummineni.html" nodeid="11958"&gt;@Gopichand Mummineni&lt;/A&gt; this is how I would do it.  I got much of this from  &lt;A rel="user" href="https://community.cloudera.com/users/168/bleonhardi.html" nodeid="168"&gt;@Benjamin Leonhardi&lt;/A&gt; feedback&lt;/P&gt;&lt;P&gt;Shell Action&lt;/P&gt;&lt;UL&gt;
&lt;LI&gt;This options requires client to be installed on all nodes&lt;/LI&gt;&lt;LI&gt;Store Keytabs on HDFS
&lt;UL&gt;
&lt;LI&gt;Secure via Ranger/ACL/Chmod&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;Use file tab to identify hdfs keytab location
&lt;UL&gt;
&lt;LI&gt;When oozie shell action runs it will download to local yarn directory&lt;/LI&gt;&lt;LI&gt;K-init inside shell script&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Wed, 20 Jul 2016 02:08:31 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-run-oozie-shell-action-for-hive-queries-in-kerberos/m-p/137133#M35149</guid>
      <dc:creator>sunile_manjee</dc:creator>
      <dc:date>2016-07-20T02:08:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to run oozie shell action for hive queries in kerberos-enabled cluster?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-run-oozie-shell-action-for-hive-queries-in-kerberos/m-p/137134#M35150</link>
      <description>&lt;P style="margin-left: 60px;"&gt; &lt;A rel="user" href="https://community.cloudera.com/users/11958/gmummineni.html" nodeid="11958"&gt;@Gopichand Mummineni&lt;/A&gt; my understand it has to be run as oozie and not foo@*.  &lt;A rel="user" href="https://community.cloudera.com/users/168/bleonhardi.html" nodeid="168"&gt;@Benjamin Leonhardi&lt;/A&gt; please confirm or correct this understanding.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jul 2016 02:18:24 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-run-oozie-shell-action-for-hive-queries-in-kerberos/m-p/137134#M35150</guid>
      <dc:creator>sunile_manjee</dc:creator>
      <dc:date>2016-07-20T02:18:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to run oozie shell action for hive queries in kerberos-enabled cluster?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-run-oozie-shell-action-for-hive-queries-in-kerberos/m-p/137135#M35151</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/11958/gmummineni.html" nodeid="11958"&gt;@Gopichand Mummineni&lt;/A&gt; - I got it working. I will write a blog and update you shortly &lt;/P&gt;</description>
      <pubDate>Wed, 27 Jul 2016 07:09:59 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-run-oozie-shell-action-for-hive-queries-in-kerberos/m-p/137135#M35151</guid>
      <dc:creator>KuldeepK</dc:creator>
      <dc:date>2016-07-27T07:09:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to run oozie shell action for hive queries in kerberos-enabled cluster?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-run-oozie-shell-action-for-hive-queries-in-kerberos/m-p/137136#M35152</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/11958/gmummineni.html" nodeid="11958"&gt;@Gopichand Mummineni&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I got this working&lt;/P&gt;&lt;P&gt;Please refer &lt;A href="https://community.hortonworks.com/content/kbentry/48132/oozie-shell-action-run-hive-query-in-shell-script.html" target="_blank"&gt;https://community.hortonworks.com/content/kbentry/48132/oozie-shell-action-run-hive-query-in-shell-script.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jul 2016 12:28:55 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-run-oozie-shell-action-for-hive-queries-in-kerberos/m-p/137136#M35152</guid>
      <dc:creator>KuldeepK</dc:creator>
      <dc:date>2016-07-29T12:28:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to run oozie shell action for hive queries in kerberos-enabled cluster?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-run-oozie-shell-action-for-hive-queries-in-kerberos/m-p/137137#M35153</link>
      <description>&lt;P&gt;Thanks for the response &lt;A rel="user" href="https://community.cloudera.com/users/504/kkulkarni.html" nodeid="504"&gt;@Kuldeep Kulkarni&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;I followed the exact same approach you explained in your blog. The only difference was that we had &lt;STRONG&gt;tez&lt;/STRONG&gt; as our execution engine for hive.&lt;/P&gt;&lt;P&gt;Anyhow, I tried this first and it didn't work. It is because I believe that I am changing the execution engine to &lt;STRONG&gt;mr&lt;/STRONG&gt; with in the hive CLI which is late because hive attempts to launch Tez AppMaster when we attempt to launch the CLI itself even before running the query.&lt;/P&gt;&lt;PRE&gt;hive -e "SET hive.execution.engine=mr; SET mapreduce.job.credentials.binary=${HADOOP_TOKEN_FILE_LOCATION}; select MAX(update_time) from test_db.test_table;" -S
&lt;/PRE&gt;&lt;P&gt;Then, I changed my command to include &lt;STRONG&gt;hiveconf &lt;/STRONG&gt;so that I am changing my execution engine to &lt;STRONG&gt;mr&lt;/STRONG&gt; even before Hive attempts to launch the Tez AppMaster. &lt;STRONG&gt;This one worked!!!&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;hive -e "SET mapreduce.job.credentials.binary=${HADOOP_TOKEN_FILE_LOCATION}; select MAX(update_time) from test_db.test_table;" -S --hiveconf hive.execution.engine=mr
&lt;/PRE&gt;&lt;P&gt;I also tried other options as well which are listed below. &lt;STRONG&gt;These didn't work either.&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;hive -e "select MAX(update_time) from test_db.test_table;" -S --hiveconf tez.credentials.path=${HADOOP_TOKEN_FILE_LOCATION} 
&lt;/PRE&gt;&lt;PRE&gt;hive -e "SET tez.credentials.path=${HADOOP_TOKEN_FILE_LOCATION}; select MAX(update_time) from test_db.test_table;" -S
&lt;/PRE&gt;I am curious to understand why passing the credentials to Tez won't work. Are you aware of any existing open apache bug for this? Understanding this better will help me in future.&lt;P&gt;Thanks again.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jul 2016 23:14:06 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-run-oozie-shell-action-for-hive-queries-in-kerberos/m-p/137137#M35153</guid>
      <dc:creator>gmummineni</dc:creator>
      <dc:date>2016-07-29T23:14:06Z</dc:date>
    </item>
  </channel>
</rss>

