hadoop fs

您所在的位置:网站首页 copyfromlocal命令 hadoop fs

hadoop fs

2023-03-29 06:39| 来源: 网络整理| 查看: 265

解决方案 / (在你的本地硬盘)?通常你不会。 您必须将 file1.txt 复制到 hdfs 用户具有读取权限的地方。

Try:

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

---编辑:

请看更清洁的罗马尼基琴科的回答。

I have constructed a single-node Hadoop environment on CentOS using the Cloudera CDH repository. When I want to copy a local file to HDFS, I used the command:

sudo -u hdfs hadoop fs -put /root/MyHadoop/file1.txt /

But,the result depressed me:

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

I'm sure this file does exist.

Please help me,Thanks!

解决方案

As user hdfs, do you have access rights to /root/ (in your local hdd)?. Usually you don't. You must copy file1.txt to a place where hdfs user has read rights.

Try:

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

--- edit:

Take a look at the cleaner roman-nikitchenko's answer bellow.

这篇关于hadoop fs -put命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3