Warning: $HADOOP_HOME is deprecated

Do you have below warnings issue for every command with your Hadoop set-up ?

Warning: $HADOOP_HOME is deprecated.

[root@hostname logs]# hadoop dfs -ls /
Warning: $HADOOP_HOME is deprecated.

Found 3 items
drwxr-xr-x – root supergroup 0 2014-07-09 09:06 /hadoop
drwxr-xr-x – root supergroup 0 2014-07-09 09:14 /home
drwxr-xr-x – root supergroup 0 2014-07-09 03:10 /tmp
[root@hostname logs]#

in your .bashrc file, replace the “HADOOP_HOME” variable with “HADOOP_PREFIX” variable, and you should be good.

[root@hostname logs]#
[root@hostname logs]# sed -i “s/HADOOP_HOME/HADOOP_PREFIX/g” ~/.bashrc
[root@hostname logs]#

[root@hostname logs]# env | grep hadoop
HADOOP_HOME=/root/hadoop-1.2.1/
HADOOP_PREFIX=/root/hadoop-1.2.1/
OLDPWD=/root/hadoop-1.2.1
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/root/hadoop-1.2.1//bin:/usr/java/jdk1.8.0_05/bin:/opt/mongodb//bin:/root/hadoop-1.2.1//bin:/usr/java/jdk1.8.0_05/bin:/opt/mongodb//bin
PWD=/root/hadoop-1.2.1/logs
[root@hostname logs]#

You’ll have to unset the VARIABLE as below

[root@hostname logs]# unset HADOOP_HOME
[root@hostname logs]#
[root@hostname logs]#
[root@hostname logs]#
[root@hostname logs]# env | grep hadoop
HADOOP_PREFIX=/root/hadoop-1.2.1/
OLDPWD=/root/hadoop-1.2.1
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/root/hadoop-1.2.1//bin:/usr/java/jdk1.8.0_05/bin:/opt/mongodb//bin:/root/hadoop-1.2.1//bin:/usr/java/jdk1.8.0_05/bin:/opt/mongodb//bin
PWD=/root/hadoop-1.2.1/logs
[root@hostname logs]#

That’s it .. you’ll no-where see those warnings.

[root@hostname logs]# hadoop dfs -ls /
Found 3 items
drwxr-xr-x – root supergroup 0 2014-07-09 09:06 /hadoop
drwxr-xr-x – root supergroup 0 2014-07-09 09:14 /home
drwxr-xr-x – root supergroup 0 2014-07-09 03:10 /tmp
[root@hostname logs]#
[root@hostname logs]#

  • Ask Question