在HDFS上存储文件的命令 [英] Command to store File on HDFS

查看:126
本文介绍了在HDFS上存储文件的命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



Hadoop NameNode和三个DataNode已经安装并正在运行。下一步是向HDFS提供一个文件。已执行以下命令:

  hadoop fs -copyFromLocal ubuntu-14.04-desktop-amd64.iso 
copyFromLocal: `。':没有这样的文件或目录

  hadoop fs -put ubuntu-14.04-desktop-amd64.iso 
put:`。':没有这样的文件或目录

不成功。

为了在HDFS上存储文件需要发出哪个命令?

解决方案

如果没有提供路径,hadoop会尝试将文件复制到hdfs主目录中。换句话说,如果您记录为 utrecht ,它会尝试将ubuntu-14.04-desktop-amd64.iso复制到 / user / utrecht 。然而,这个文件夹不是从零开始存在的(你通常可以通过网络浏览器来检查dfs)。
为了让你的命令行得通,你有两种选择:
$ b


  • 把它复制到别处( / code>可以工作,但将所有内容放在一起可能会导致将来出现复杂问题)

  • 使用 hdfs dfs -mkdir / yourFolderPath


Introduction

A Hadoop NameNode and three DataNodes have been installed and are running. The next step is to provide a File to HDFS. The following commands have been executed:

hadoop fs -copyFromLocal ubuntu-14.04-desktop-amd64.iso
copyFromLocal: `.': No such file or directory

and

hadoop fs -put ubuntu-14.04-desktop-amd64.iso
put: `.': No such file or directory

without succes.

Question

Which command needs to be issued in order to store a file on HDFS?

解决方案

If no path is provided, hadoop will try to copy the file in your hdfs home directory. In other words, if you're logged as utrecht, it will try to copy ubuntu-14.04-desktop-amd64.iso to /user/utrecht.

However, this folder doesn't exist from scratch (you can normally check the dfs via a web browser). To make your command work, you have two choices :

  • copy it elsewhere (/ works, but putting everything there may lead to complications in the future)
  • create the directory you want with hdfs dfs -mkdir /yourFolderPath

这篇关于在HDFS上存储文件的命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆