I am trying to install hadoop with the tutorial from tutorialspoint. I just sucessfully installed hadoop2.9.0. I then tried to set up the namenode using the command “hdfs namenode -format” as follows.
$ hdfs namenode -format Yet the terminal answered me :
bash: /usr/local/hadoop/bin/hdfs: Permission denied So I did :
mike@mike-thinks:~$ sudo chown -R mike /usr/local/hadoop But even with it I still get :
mike@mike-thinks:~$ sudo hdfs namenode -format sudo: hdfs: command not found 21 Answer
I hope this error is resolved by now, but this error occurs because the hdfs path may not be set, so first check hdfs path by using this command,
which hdfs if path is not set, then check the environment variable in ~/.bash_profile if it PATH is written like this,
PATH=$PATH:$HOME/bin change it to this PATH=$PATH:$HADOOP_HOME/bin
source ~/.bash_profile then check the your hdfs path, if it is set by using which command(as shown above) Then your problem might get resolved. Hope this helps!