Warning: $HADOOP_HOME is deprecated.解决方法

时间:2022-01-10 15:00:40

方式1(不推荐):注释hadoop-config.sh中的

if [ "$HADOOP_HOME_WARN_SUPPRESS" = "" ] && [ "$HADOOP_HOME" != "" ]; then

echo "Warning: \$HADOOP_HOME is deprecated." 1>&2

echo 1>&2

fi

方式2::修改环境变量

可以是用当前用户的环境变量也可以是全局环境变量

添加 export HADOOP_HOME_WARN_SUPPRESS=1

source /etc/profile 立即生效

测试警告消失!

[root@h1 conf]# hadoop fs -help

hadoop fs is the command to execute fs commands. The full syntax is:

hadoop fs [-fs <local | file system URI>] [-conf <configuration file>]

[-D <property=value>] [-ls <path>] [-lsr <path>] [-du <path>]

[-dus <path>] [-mv <src> <dst>] [-cp <src> <dst>] [-rm [-skipTrash] <src>]

[-rmr [-skipTrash] <src>] [-put <localsrc> ... <dst>] [-copyFromLocal <localsrc> ... <dst>]

[-moveFromLocal <localsrc> ... <dst>] [-get [-ignoreCrc] [-crc] <src> <localdst>

[-getmerge <src> <localdst> [addnl]] [-cat <src>]

[-copyToLocal [-ignoreCrc] [-crc] <src> <localdst>] [-moveToLocal <src> <localdst>]