Hadoop:hadoop fs、hadoop dfs与hdfs dfs命令的区别
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了Hadoop:hadoop fs、hadoop dfs与hdfs dfs命令的区别,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含4613字,纯文字阅读大概需要7分钟。
内容图文
![Hadoop:hadoop fs、hadoop dfs与hdfs dfs命令的区别](/upload/InfoBanner/zyjiaocheng/1238/d3c2fdf32a9d4edab765c7ff7bf73226.jpg)
http://blog.csdn.net/pipisorry/article/details/51340838
‘Hadoop DFS‘和‘Hadoop FS‘的区别
> hadoop fs
why we have two different syntaxes for a common purpose
为什么会对同一个功能提供两种命令标记?
命令的定义
it seems like there‘s no difference between the two syntaxes. If we look at the definitions of the two commands (hadoop fs and hadoop dfs) in $HADOOP_HOME/bin/hadoopelif [ "$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"
...
貌似更有道理的解释
Unconvinced, and these excerpts made more sense to me:
FS relates to a generic file system which can point to any file systems like local, HDFS etc. But dfs is very specific to HDFS. So when we use FS it?can perform operation with from/to local or hadoop distributed file system to destination. But specifying DFS operation relates to?HDFS.这个理由并不完全信服,下面这个解释貌似更有道理:
Hadoop文档对这两个不同的shell的描述
下面是两个摘录Hadoop文档,描述这两个不同的shell。
- FS Shell
- 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.?
- DFShell
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 in HDFS shell behave like corresponding Unix commands.?
[http://java.dzone.com/articles/difference-between-hadoop-dfs]
stackoverflow的解释
Hadoop fs:使用面最广,可以操作任何文件系统。
hadoop dfs与hdfs dfs:只能操作HDFS文件系统相关(包括与Local FS间的操作),前者已经Deprecated,一般使用后者。
Following are the three commands which appears same but have minute differences
- hadoop fs {args}
- hadoop dfs {args}
-
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, HFTP FS, S3 FS, 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.
**#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
ref:
原文:http://blog.csdn.net/pipisorry/article/details/51340838
内容总结
以上是互联网集市为您收集整理的Hadoop:hadoop fs、hadoop dfs与hdfs dfs命令的区别全部内容,希望文章能够帮你解决Hadoop:hadoop fs、hadoop dfs与hdfs dfs命令的区别所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。