Why is it keep showing deprecated error when runni

2019-02-05 09:11发布

问题:

I've installed hadoop-2.0.0-alpha, but whenever I execute a command, it gives me deprecation errors (although it seems like to be running without problem)

$ hadoop/bin/hadoop dfs -copyFromLocal input input
DEPRECATED: Use of this script to execute hdfs command is deprecated.
Instead use the hdfs command for it.

$ hadoop/bin/hadoop dfs -rmr input
DEPRECATED: Use of this script to execute hdfs command is deprecated.
Instead use the hdfs command for it.

rmr: DEPRECATED: Please use 'rm -r' instead.

I googled around and it looks like it's a bug for hadoop-0.23. However, my version is more recent.

I couldn't find an answer for this version, is it still an existing bug?

回答1:

dfs was deprecated in favor of "fs" command. For example, this:

hadoop fs -copyFromLocal input input // this uses FsShell

instead of this:

hadoop dfs -copyFromLocal input input // this uses the now deprecated HDFS-specific DFSShell

Some good background on what the differences were here:

http://nsinfra.blogspot.com/2012/06/difference-between-hadoop-dfs-and.html