Hadoop:hadoop FS, Hadoop DFS and HDFs DFS command differences

Source: Internet
Author: User
Tags deprecated hdfs dfs hadoop fs

http://blog.csdn.net/pipisorry/article/details/51340838

the difference between ' Hadoop DFS ' and ' Hadoop FS 'While exploring HDFs, I came across these II syntaxes for querying HDFs:
> Hadoop DFS
> Hadoop FS

Why we have both different syntaxes for a common purpose
Why are there two command flags for the same feature? The definition of the command it seems like there ' s no difference between the two syntaxes. If We look at the definitions of the commands (Hadoop FS and Hadoop Dfs) in $HADOOP _home/bin/hadoop
From the definition of two commands (in $hadoop_home/bin/hadoop) you can see that there seems to be no difference between the two. ...
elif ["$COMMAND" = "Datanode"]; Then
class= ' Org.apache.hadoop.hdfs.server.datanode.DataNode '
hadoop_opts= "$HADOOP _opts $HADOOP _datanode_opts"
elif ["$COMMAND" = "FS"]; Then
Class=org.apache.hadoop.fs.fsshell
hadoop_opts= "$HADOOP _opts $HADOOP _client_opts"
elif ["$COMMAND" = "Dfs"]; Then
Class=org.apache.hadoop.fs.fsshell
hadoop_opts= "$HADOOP _opts $HADOOP _client_opts"
elif ["$COMMAND" = "dfsadmin"]; Then
Class=org.apache.hadoop.hdfs.tools.dfsadmin
hadoop_opts= "$HADOOP _opts $HADOOP _client_opts"
...
A more plausible explanation.

Unconvinced, and these excerpts made more sense to me:

FS relates to a generic the file system which can point to any of the file systems like local, HDFS etc. But Dfs was very specific to HDFS. So, we use the FS It?can perform operation with from/to local or Hadoop distributed the file system to destination. But specifying DFS operation relates to? Hdfs.
This reason is not entirely convincing, the following explanation seems more reasonable: FS involves a common file system, can point to any file system such as Local,hdfs. However, DFS is only for HDFs. So when do we use FS? Can be used on-premises with Hadoop Distributed File system interoperability. Specific DFS directives are related to HDFs. The Hadoop document describes these two different shells below is two excerpts from the Hadoop documentation that describe these two as different shells.

Here are two excerpts from the Hadoop document describing the two different shells.

  1. FS Shell
  2. the filesystem  (FS)  shell is invoked by bin/hadoop fs. All  The fs shell commands take path uris as arguments. the uri  format is scheme://autority/path. for hdfs the scheme is hdfs,  and for the local filesystem the scheme is file. The  Scheme and authority are optional. if not specified, the default  scheme specified in the configuration is used. an hdfs file  or directory such as /parent/child can be specified as hdfs ://namenodehost/parent/child or simply as /parent/child  (Given that your  configuration is set to point to hdfs://namenodehost).  Most of  the commandS in fs shell behave like corresponding unix commands.?  
  1. Dfshell
  2. The hdfs shell is invoked by bin/hadoop dfs. all the hdfs  shell commands take path uris as arguments. the uri format  is scheme://autority/path. for hdfs the scheme is hdfs, and  for the local filesystem the scheme is file. the scheme  and authority are optional. If not specified, the default  scheme specified in the configuration is used. an hdfs file  or directory such as /parent/child can be specified as hdfs:// namenode:namenodeport/parent/child or simply as /parent/child  (given that  Your configuration is set to point to namenode:namenodeport).  Most  of the commands&Nbsp;in hdfs shell behave like corresponding unix commands.?  

So, based on the above, we can conclude this it all depends on the scheme configuration. When using these the commands with absolute URI (i.e. scheme://a/b) The?behavior?shall is identical. Only it's the default configured scheme value for file and HDFs for FS and DFS respectively, which are the cause for differ ence In?behavior. As can be seen from the above, these two commands depend on the configuration of the pattern. When using an absolute URI (such as scheme://a/b), the two commands are the same. Only the default mode configuration parameters work for DFS and FS.
[Http://java.dzone.com/articles/difference-between-hadoop-dfs] Phi Phi Blog
StackOverflow's explanation

Hadoop FS: Use the widest range of surfaces to manipulate any file system.

Hadoop DFS and HDFs DFS: can only operate on HDFs file system-related (including operations with local FS), which is already deprecated, typically using the latter.

Following is the three commands which appears same but has minute differences

  1. Hadoop fs {args}
  2. Hadoop dfs {args}
  3. HDFs Dfs {args}

    Hadoop FS <args>

FS relates to a generic the file system which can point to any of the file systems like local, HDFS etc. So the can is used when you is dealing with different file systems such as Local FS, Hftp FS, S3 FS, and others

  Hadoop DFS <args>

DFS is very specific to HDFS. Would work for operation relates to HDFS. This have 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.

  * * #hdfs commands**  namenode|secondarynamenode|datanode|dfs|dfsadmin|fsck|balancer|fetchdt|oiv|dfsgroups

So even if you use Hadoop DFS, it would look locate HDFs and delegate that command to HDFs DFS

[ when to use Hadoop FS, Hadoop DFS and HDFs DFS commands ]

from:http://blog.csdn.net/pipisorry/article/details/51340838

Ref


Hadoop:hadoop FS, Hadoop DFS and HDFs DFS command differences

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.