首页 > 解决方案 > 高可用HDFS客户端python

问题描述

在 HDFSCLI 文档中,它说可以通过添加用分号分隔的 url ;( https://hdfscli.readthedocs.io/en/latest/quickstart.html#configuration ) 将其配置为连接到多个主机。我使用 kerberos 客户端,这是我的代码 - from hdfs.ext.kerberos import KerberosClient hdfs_client = KerberosClient('http://host01:50070;http://host02:50070')

例如,当我尝试 makedir 时,我收到以下错误 -requests.exceptions.InvalidURL: Failed to parse: http://host01:50070;http://host02:50070/webhdfs/v1/path/to/create

标签: pythonhdfswebhdfs

解决方案


显然hdfs我安装的版本是旧的,代码不适用于 version 2.0.8,它确实适用于 version2.5.7


推荐阅读