python - hadoop 得到 'No such file or directory'

标签 python python-2.7 hadoop

我在 python 2.7 中使用多进程,我需要使用命令 hadoop fs -getHDFS 获取文件.

但是执行的时候

os.system('hadoop fs -get hdfs_file local_file')

在python代码中,多进程会发生冲突,部分进程会打印错误:

'get: No such file or directory'

部分流程会打印

'get: File local_file._COPYING_ does not exist'

如果我在后面的 python 代码中读取这个,我将读取一个空文件。

有什么解决方案可以解决这个问题吗?或者如果多进程架构不可移除,我应该如何获取HDFS文件?

最佳答案

在命令提示符下运行以下代码:

hadoop fs -ls /hdfs_file local_file

关于python - hadoop 得到 'No such file or directory',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56443028/

相关文章:

python - 如何为每个子图添加标题

python - 如何在 python 2.7 中使用 "e"(欧拉数)和电源操作

powershell - JWT token 的安全 token 验证错误 -- HDInsight

python - 使用 numpy 数组的元素作为另一个 numpy 数组的索引

python - NumPy 如何实现其复数字面量?

python - Gauss-Legendre 区间 -x -> 无穷大 : adaptive algorithm to transform weights and nodes efficiently

python 包导入模块使用 __init__.py

python - 将混合数据类型的元组列表转换为所有字符串

hadoop - 如何在Apache PIG中的同一文件中添加数据?

apache-spark - 如何在 NiFi 中从 GetFilesProcessor 读取文件