shell – hadoop fs -put命令

前端之家收集整理的这篇文章主要介绍了shell – hadoop fs -put命令前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我使用Cloudera CDH存储库在CentOS上构建了单节点Hadoop环境。当我想将本地文件复制到HDFS时,我使用了以下命令:
sudo -u hdfs hadoop fs -put /root/MyHadoop/file1.txt /

但结果让我郁闷:

put: '/root/MyHadoop/file1.txt': No such file or directory

我确定这个文件确实存在。

请帮助我,谢谢!

作为用户hdfs,您是否具有/ root /(在本地hdd中)的访问权限?通常你不会。
您必须将file1.txt复制到hdfs用户具有读取权限的地方。

尝试:

cp /root/MyHadoop/file1.txt /tmp
chown hdfs:hdfs /tmp/file1.txt
sudo -u hdfs hadoop fs -put /tmp/file1.txt /

—编辑:

看看the cleaner roman-nikitchenko’s answer bellow

原文链接:https://www.f2er.com/bash/387856.html

猜你在找的Bash相关文章