如何在我的系统上找到Hadoop hdfs目录? [英] How to find Hadoop hdfs directory on my system?

查看:823
本文介绍了如何在我的系统上找到Hadoop hdfs目录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在我的系统上找到Hadoop HDFS目录? 我需要它来运行以下命令-

How to find Hadoop HDFS directory on my system? I need this to run following command -

hadoop dfs -copyFromLocal <local-dir> <hdfs-dir>

在此命令中,我不知道我的hdfs-dir.

In this command I don't knon my hdfs-dir.

不确定它是否有用,但我运行以下命令并获得了此输出-

Not sure if its helpful or not but I ran following command and got this output -

 hdfs dfs -ls
-rw-r--r--   3 popeye hdfs  127162942 2016-04-01 19:47 .

在hdfs-site.xml中,我找到了以下条目-

In hdfs-site.xml, I found following entry -

<property>
      <name>dfs.datanode.data.dir</name>
      <value>/hadoop/hdfs/data</value>
      <final>true</final>
</property>

我试图运行以下命令,但它给出了错误-

I tried to run following command but it gives error -

[root@sandbox try]# hdfs dfs -copyFromLocal 1987.csv /hadoop/hdfs/data
copyFromLocal: `/hadoop/hdfs/data': No such file or directory

仅供参考-我正在azure服务器上的hortonworks沙箱中完成所有操作.

FYI - I am doing all this on hortonworks sandbox on azure server.

推荐答案

您的方法错误或可能理解错误

Your approach is wrong or may be understanding is wrong

dfs.datanode.data.dir,是您要存储数据块的地方

dfs.datanode.data.dir, is where you want to store your data blocks

如果键入hdfs dfs -ls /,则将获取hdfs中的目录列表.然后,您可以使用-copyFromLocal-put将文件从本地传输到hdfs到特定目录,或者使用-mkdir您可以创建新目录

If you type hdfs dfs -ls / you will get list of directories in hdfs. Then you can transfer files from local to hdfs using -copyFromLocal or -put to a particular directory or using -mkdir you can create new directory

请参阅下面的链接以获取更多信息

Refer below link for more information

http://hadoop.apache. org/docs/current/hadoop-project-dist/hadoop-hdfs/HDFSCommands.html

这篇关于如何在我的系统上找到Hadoop hdfs目录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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