python - 高可用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
解决方案
显然hdfs
我安装的版本是旧的,代码不适用于 version 2.0.8
,它确实适用于 version2.5.7
推荐阅读
- azure-active-directory - “具有个人帐户的多租户”应用程序类型需要 Azure AD 用户分配
- c - 为什么即使我在while上创建变量,循环while也不在每个循环之后创建新的?
- python-3.x - 如何使用 Python 3 + 更快地遍历范围至少为 2 位 (10) 到 1000 位 (10^100) 的循环?
- python - 断言列表中的所有项目都满足 Python 中的条件
- javascript - 未捕获的语法错误:意外的标记“如果”
- mongodb - 如何在MongoDB的查询中执行多列
- pyspark - 如何将两个 Spark RDD 列表组合成一个元组列表
- javascript - 如何将 jQuery 动画函数转换为纯 JS
- css - 在 Rollup / Bili build 期间从 CSS url(...) 复制图像
- sql-server - SSIS SQL Server 代理计划