Reputation: 11
In addition to previous asked question
I am trying to format namenode in hdfs but says: permission denied
for which I had not any responses but again I am posting what I have done to remove permissions to get job done:
I have tried command: Both below commands are from thread: Permission denied at hdfs
sudo -u hduser bash
edits hdfs-site.xml
using as:hduser@Ubuntu:/usr/hadoop/hadoop-2.7.1/etc/hadoop$ sudo gedit hdfs-site.xml
In this I have added permission as false:
<property>
<name>dfs.permissions</name>
<value>false</value>
</property>
and running the command again :
hduser@Ubuntu:/usr/hadoop/hadoop-2.7.1$ bin/hdfs namenode -format 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
and when I use it with sudo
It gives :
hduser@Ubuntu:/usr/hadoop/hadoop-2.7.1$ sudo bin/hdfs namenode -format bin/hdfs: line 304: /root/software/jdk1.8.0_45/bin/java: No such file or directory
What could be the solution.
Upvotes: 0
Views: 1492
Reputation: 11
hduser@Ubuntu:/usr/hadoop/hadoop-2.7.1/etc/hadoop$ echo $JAVA_HOME
hduser@Ubuntu:/usr/hadoop/hadoop-2.7.1/etc/hadoop$ echo $JAVA_HOME
By the way It started with the command sbin/start-all.sh and then jps But namenode is not started yet. What to do for that @Bovas_Chinnathambi
Upvotes: 0
Reputation: 1
Updated my answer with the previous post:
In this case, you can try installing openjdk in your machine and set it for hadoop.
Hopefully this should solve your issue.
Note: Verify the java path after setting, by the command echo $JAVA_HOME
Previous post:
This could not be the issue with Hadoop, Since the hadoop process is not able to execute the java itself.
FYI: Its not recommendable to have the jdk directory in the root folder, since hadoop or java can be run by any of the users on the machine. So you can move the jdk directory to /usr/lib or /opt/ directories.
Upvotes: 0