简体   繁体   English

使用Livy连接到Kerberized Hadoop集群时,Python请求Post请求失败

[英]Python Requests Post request fails when connecting to a Kerberized Hadoop cluster with Livy

I'm trying to connect to a kerberized hadoop cluster via Livy to execute Spark code. 我正在尝试通过Livy连接到kerberized hadoop集群来执行Spark代码。 The requests call im making is as below. 请求调用im如下。

kerberos_auth = HTTPKerberosAuth(mutual_authentication=REQUIRED, force_preemptive=True)
r = requests.post(host + '/sessions', data=json.dumps(data), headers=headers, auth=kerberos_auth)

This call fails with the following error 此调用失败,并显示以下错误

GSSException: No valid credentials provided (Mechanism level: Failed to find any Kerberos credentails) GSSException:未提供有效凭据(机制级别:无法找到任何Kerberos凭据)

Any help here would be appreciated. 任何帮助在这里将不胜感激。

When running Hadoop service daemons in Hadoop in secure mode, Kerberos tickets are decrypted with a keytab and the service uses the keytab to determine the credentials of the user coming into the cluster. 在安全模式下在Hadoop中运行Hadoop服务守护程序时,Kerberos票证将使用密钥表进行解密,并且该服务使用密钥表来确定进入集群的用户的凭据。 Without a keytab in place with the right service principal inside of it, you will get this error message. 如果没有keytab,并且其中包含正确的服务主体,您将收到此错误消息。 Please refer to Hadoop in Secure Mode for further details on setting up the keytab. 有关设置密钥表的更多详细信息,请参阅安全模式下的Hadoop

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM