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 -formatYet the terminal answered me :
bash: /usr/local/hadoop/bin/hdfs: Permission deniedSo I did :
mike@mike-thinks:~$ sudo chown -R mike /usr/local/hadoopBut even with it I still get :
mike@mike-thinks:~$ sudo hdfs namenode -format
sudo: hdfs: command not found 2 1 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 hdfsif path is not set, then check the environment variable in ~/.bash_profile if it PATH is written like this,
PATH=$PATH:$HOME/binchange it to this PATH=$PATH:$HADOOP_HOME/bin
source ~/.bash_profilethen 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!