我在 python 2.7
中使用多进程,我需要使用命令 hadoop fs -get从
.HDFS
获取文件
但是执行的时候
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/