ubuntuhadoophdfs

'HADOOP_COMMON_HOME' error while installing hadoop


I am installing hadoop (3.2.2) on Ubuntu 18.04 on VMFusion for the first time. At the end of the installation when I run 'hdfs namenode -format' it shows: ERROR: Invalid HADOOP_COMMON_HOME.

This is what I have on .bashrc:

export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
export HADOOP_HOME=/usr/local/hadoop
export PATH=$PATH:$HADOOP_HOME
export HADOOP_HDFS_HOME=HADOOP_HOME
export HADOOP_MAPRED_HOME=HADOOP_HOME
export YARN_HOME=HADOOP_HOME
export HADOOP_COMMON_HOME=HADOOP_HOME
export HADOOP_COMMON_LIB_NATIVE_DIR=HADOOP_HOME/lib/native
export PATH=PATH:JAVA_HOME/bin:HADOOP_HOME/bin:HADOOP_HOME/sbin
export HADOOP_OPTS="HADOOP_OPTS -Djava.library.path=HADOOP_HOME/lib/native"

Thanks in advance for your advice.


Solution

  • Whenever you reference a variable you need to prefix with a $, i.e.:

    export HADOOP_HDFS_HOME=$HADOOP_HOME