当使用oozie在hive上执行查询时,如何修复“只能通过kerberos或web身份验证发布委派令牌”?

46scxncf  于 2021-06-26  发布在  Hive
关注(0)|答案(2)|浏览(296)

当我试图在oozie中编写通过使用配置单元上下文查询配置单元而获得的Dataframe时,我得到以下异常。可能是什么问题

Caused by: org.apache.spark.sql.catalyst.errors.package$TreeNodeException: execute, tree:
TungstenExchange hashpartitioning
at org.apache.spark.sql.catalyst.errors.package$.attachTree(package.scala:49)
    at org.apache.spark.sql.execution.Exchange.doExecute(Exchange.scala:247)
    at org.apache.spark.sql.execution.SparkPlan$$anonfun$execute$5.apply(SparkPlan.scala:132)
    at org.apache.spark.sql.execution.SparkPlan$$anonfun$execute$5.apply(SparkPlan.scala:130)
    at org.apache.spark.rdd.RDDOperationScope$.withScope(RDDOperationScope.scala:150)
    at org.apache.spark.sql.execution.SparkPlan.execute(SparkPlan.scala:130)

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:7496)
    at org.apache.hadoop.hdfs.server.namenode.NameNodeRpcServer.getDelegationToken(NameNodeRpcServer.java:548)
    at org.apache.hadoop.hdfs.server.namenode.AuthorizationProviderProxyClientProtocol.getDelegationToken(AuthorizationProviderProxyClientProtocol.java:663)
    at org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolServerSideTranslatorPB.getDelegationToken(ClientNamenodeProtocolServerSideTranslatorPB.java:981)
c3frrgcw

c3frrgcw1#

上面的分析是正确的,但是解决方案不适合我。相反,也可以告诉spark忽略oozie已经请求的代币,这为我做到了:

--conf spark.yarn.security.tokens.hadoopfs.enabled=false
--conf spark.yarn.security.credentials.hadoopfs.enabled=false
fivyi3re

fivyi3re2#

这是因为oozie在启动spark操作之前已经获得了委托令牌。
解决方案是通过在workflow.xml中的spark action中添加以下内容,请求spark不要再次获取委派令牌:

<spark-opts>--conf spark.yarn.security.tokens.hive.enabled=false</spark-opts>

相关问题