Hadoop installation Issue:Permission denied

Viewed 1425

I followed this tutorial for installation of Hadoop. Unfortunately, when I run the dfs namenode -format script - The following error was printed on console:

but at the end i see this msg

dfs namenode -format

WARNING: /home/hdoop/hadoop-3.2.1/logs does not exist. Creating.
mkdir: cannot create directory ‘/home/hdoop/hadoop-3.2.1/logs’: Permission denied
ERROR: Unable to create /home/hdoop/hadoop-3.2.1/logs. Aborting.

thank u also when i run

./start-dfs.sh

Starting namenodes on [localhost]
localhost: WARNING: /home/hdoop/hadoop-3.2.1/logs does not exist. Creating.
Starting datanodes
Starting secondary namenodes [blabla]
blabla: Warning: Permanently added 'blabla,192.168.100.10' (ECDSA) to the list of known hosts.
3 Answers

change the permission of /home/hdoop to the correct one!

i sloved this link here According to my configuration i didn't set JAVA_HOME within PATH

$ which java
$ echo $JAVA_HOME 

Also,i change the value of HADOOP_OPTS in hadoop-env.sh as given below.

export HADOOP_OPTS="-Djava.library.path=$HADOOP_HOME/lib/"

the image before and after enter image description here enter image description here

  1. Create Directory :- Create "logs" directory by using root access yourself.As in this case directory was logs create it at /home/hdoop/hadoop-3.2.1/ (eg. "/home/{username}/{extracted hadoop directory}/" )
  2. Give Access of Directory :- Make it accessible by using sudo chmod 777 {directory location} In this case - sudo chmod 777 /home/hdoop/hadoop-3.2.2/logs To see it worked in my case see following image : solved it by giving access of following directory
Related