如何访问Hadoop HDFS中的文件? [英] How to access files in Hadoop HDFS?
问题描述
当我输入 hdfs dfs -ls / user /...
我可以看到.jar文件在那里 - 然而,当我打开Eclipse并尝试导入它时,我只需似乎在任何地方找到它。我在我的文件系统中看到一个hadoop / hdfs文件夹,它将我带到2个文件夹; namenode和namesecondary - 这些都没有我正在寻找的文件。
任何想法?我已经停留了一段时间。提前感谢任何帮助。
HDFS文件系统和本地文件系统都不同。
可以使用以下命令将jar文件从hdfs文件系统复制到您本地文件中的首选位置:
bin / hadoop fs - copyToLocal locationOfFileInHDFS locationWhereYouWantToCopyFileInYourFileSystem
例如
bin / hadoop fs -copyToLocal file.jar /home/user/file.jar
我希望这可以帮助你。
I have a .jar file (containing a Java project that I want to modify) in my Hadoop HDFS that I want to open in Eclipse.
When I type hdfs dfs -ls /user/...
I can see that the .jar file is there - however, when I open up Eclipse and try to import it I just can't seem to find it anywhere. I do see a hadoop/hdfs folder in my File System which takes me to 2 folders; namenode and namesecondary - none of these have the file that I'm looking for.
Any ideas? I have been stuck on this for a while. Thanks in advance for any help.
HDFS filesystem and local filesystem are both different.
You can copy the jar file from hdfs filesystem to your preferred location in your local filesytem by using this command:
bin/hadoop fs -copyToLocal locationOfFileInHDFS locationWhereYouWantToCopyFileInYourFileSystem
For example
bin/hadoop fs -copyToLocal file.jar /home/user/file.jar
I hope this helps you.
这篇关于如何访问Hadoop HDFS中的文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!