1
votes

I am trying to format namenode . For this I have tried.

hduser@Ubuntu:/usr/hadoop/hadoop-2.7.1$ bin/hdfs namenode -format

It says:

bin/hdfs: line 304: /root/software/jdk1.8.0_45/bin/java: Permission denied
bin/hdfs: line 304: exec: /root/software/jdk1.8.0_45/bin/java: cannot execute: Permission denied
1
Formatting: shell commands and output - moshbear
[15-second guess] If hdfs isn't running as root, why is it accessing paths in /root? /root is mode 0700 for a reason :) - moshbear
so what is the reason and how can I get out of it?? @moshbear - Aevi
@Donald_Miner. Can You help Sir, as I am new to hadoop. - Aevi

1 Answers

1
votes

So, you have an odd install. It looks like you are trying to reference a JDK installation that is installed to /root (this is very unusual). You are getting permission denied because you are trying to run a command as a non-privileged that depends on that JDK installation that your user can't access.

Running as root would probably make this error go away but you probably have an unorthodox installation that might need to be reconsidered.