“hadoop fs”的区别是什么? shell命令和“hdfs dfs” shell命令? [英] what's the difference between "hadoop fs" shell commands and "hdfs dfs" shell commands?

查看:484
本文介绍了“hadoop fs”的区别是什么? shell命令和“hdfs dfs” shell命令?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

它们应该是相等的吗?



但是,为什么 hadoop fs 命令显示 hdfs文件,而 hdfs dfs 命令显示本地文件?



这里是hadoop的版本信息:

lockquote
Hadoop 2.0.0-mr1-cdh4.2.1 Subversion
git: //ubuntu-slave07.jenkins.cloudera.com/var/lib/jenkins/workspace/CDH4.2.1-Packaging-MR1/build/cdh4/mr1/2.0.0-mr1-cdh4.2.1/source
- r编译jenkins于星期一4月22日10:48:26 PDT 2013



解决方案

以下是这三个命令看起来是一样的,但有细微的差别。


  1. hadoop fs {args}

  2. hadoop dfs {args}

  3. hdfs dfs {args} ol>




      hadoop fs< args> 

    FS涉及一个通用文件系统,可指向任何文件系统,如本地,HDFS等。这可以在您处理不同文件系统时使用,例如本地FS,(S)FTP,S3和其他文件系统。




      hadoop dfs< args> 

    dfs对于HDFS非常具体。将为与HDFS有关的操作工作。这已被弃用,我们应该使用 hdfs dfs 来代替。




      hdfs dfs< args> 

    与第二部分相同可以适用于所有与HDFS相关的操作,并且是推荐的命令,而不是 hadoop dfs

    下面是被分类为 hdfs 命令的列表。

      namenode | secondarynamenode | datanode | dfs | dfsadmin | fsck | balancer | fetchdt | oiv | dfsgroups 

    因此,即使您使用 hadoop dfs ,它也会查找hdfs并将该命令委托给 hdfs dfs


    Are they supposed to be equal?

    but, why the "hadoop fs" commands show the hdfs files while the "hdfs dfs" commands show the local files?

    here is the hadoop version information:

    Hadoop 2.0.0-mr1-cdh4.2.1 Subversion git://ubuntu-slave07.jenkins.cloudera.com/var/lib/jenkins/workspace/CDH4.2.1-Packaging-MR1/build/cdh4/mr1/2.0.0-mr1-cdh4.2.1/source -r Compiled by jenkins on Mon Apr 22 10:48:26 PDT 2013

    解决方案

    Following are the three commands which appears same but have minute differences

    1. hadoop fs {args}
    2. hadoop dfs {args}
    3. hdfs dfs {args}


      hadoop fs <args>
    

    FS relates to a generic file system which can point to any file systems like local, HDFS etc. So this can be used when you are dealing with different file systems such as Local FS, (S)FTP, S3, and others


      hadoop dfs <args>
    

    dfs is very specific to HDFS. would work for operation relates to HDFS. This has been deprecated and we should use hdfs dfs instead.


      hdfs dfs <args>
    

    same as 2nd i.e would work for all the operations related to HDFS and is the recommended command instead of hadoop dfs

    below is the list categorized as hdfs commands.

      namenode|secondarynamenode|datanode|dfs|dfsadmin|fsck|balancer|fetchdt|oiv|dfsgroups
    

    So even if you use hadoop dfs , it will look locate hdfs and delegate that command to hdfs dfs

    这篇关于“hadoop fs”的区别是什么? shell命令和“hdfs dfs” shell命令?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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