python webhdfs kerberos不起作用



我需要帮助,我正在使用WebHDFS(还使用此Python代码来调用Hadoop命令https://gist.github.com/drelu/1529478)。对于我的系统,它是使用KDC进行的。我能够做卷曲,但是我不知道如何在上述Python代码中使用此curl命令。感谢你的帮助。我的卷曲命令如下:

curl -cacert/opt/cloudera/security/cacerts/rootc.cer-negotiate -u https://localhost:140000/webhdfs/v1/?op = listStatus

>

谢谢

有几种方法可以做

  1. 与pywebhdfs python客户端https://github.com/pywebhdfs/pywebhdfs/issues/16#issuecomment-243776503
  2. 没有pywebhdfs直接调用webHDFS ret call
    示例代码:https://plenium.wordpress.com/2018/07/26/run-a-python-program-program-comcess-to-cess-hadoop-with-kerberos-enabled/

在这两种方法上,您需要使用requests_kerberos模块创建身份验证标头https://github.com/requests/requests-kerberoswrequests-kerberos#requests-kerberosgsgssapi-authentication-library library

  1. 可以使用HDFSCli Python模块 https://hdfscli.readthedocs.io/en/latest/

在所有情况下,都需要手动完成Kinit(您可以使用一些Python Shell Executor模块,例如SubProcess,命令。

最新更新