-2

I see that hadoop and hdfs command line tools can perform identical operations. For example I can run example.jar using

hadoop jar example.jar

And the same using

hdfs -jar example.jar

What is difference between these two command line tools?

Vitalii Vitrenko
  • 9,763
  • 4
  • 43
  • 62

1 Answers1

3

I believe the only difference in the commands is related to the file system.

hadoop fs is able to communicate with various file systems.

hdfs dfs is only for HDFS.

what's the difference between "hadoop fs" shell commands and "hdfs dfs" shell commands?


The rest of the commands, such as jar, are basically aliases, and if you use HDFS as your file system, compared to S3, for example, there is mostly no difference, though it's been said that hdfs binary is deprecated

OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
  • I also noticed that if I use pseudo distributed mode and run `hdfs -jar example.jar` it will actually be executed in standalone mode (basically it just run a jar without awaring of hadoop cluster) but `hadoop jar example.jar` will be in pseudo distributed mode as expected. – Vitalii Vitrenko Jan 12 '18 at 12:13
  • You should be using `yarn jar` anyway as pointed out https://hadoop.apache.org/docs/current/hadoop-project-dist/hadoop-common/CommandsManual.html#jar – OneCricketeer Jan 12 '18 at 14:49