Support Questions
Find answers, ask questions, and share your expertise

HDPCD Task 01 Issue

Highlighted

HDPCD Task 01 Issue

Explorer

I am having issue executing task 01 from practice set. I am not able to copy flightsdelays cvs files. I tried many options. Following is command and error message. I was having problem creating directory but i used

"horton@ip-172-31-30-193:~$ hadoop fs -copyFromLocal /home/horton/datasets/flightdelays/flight_delays*.csv /user/horton/flightdelays copyFromLocal: Permission denied: user=horton, access=WRITE, inode="/user/horton/flightdelays":hdfs:hdfs:drwxr-xr-x"

horton@ip-172-31-30-193:~$ hadoop fs -copyFromLocal /home/horton/datasets/flightdelays/flight_delays*.csv /user/horton/flightdelays copyFromLocal: Permission denied: user=horton, access=WRITE, inode="/user/horton/flightdelays":hdfs:hdfs:drwxr-xr-x

7 REPLIES 7
Highlighted

Re: HDPCD Task 01 Issue

Super Guru

@Ranjeet Kumar

User horton won't having permissions to write the HDFS directory /user/horton/flightdelays

change the permissions on the HDFS directory

bash$ sudo su root
bash$ hadoop fs  -chmod -R 777 /user/horton/flightdelays 

then execute your copy from local command

bash$ hadoop fs -copyFromLocal /home/horton/datasets/flightdelays/flight_delays*.csv /user/horton/flightdelays
Highlighted

Re: HDPCD Task 01 Issue

Super Guru

@Ranjeet Kumar

To exit Namenode from safe mode execute the below command

bash$ Sudo -u hdfs
bash$ hdfs dfsadmin -safemode leave

Then try to change the permissions using above answer commands.

Highlighted

Re: HDPCD Task 01 Issue

Super Guru
@Ranjeet Kumar

Try with

bash$ sudo su - root
bash$ hadoop fs -chmod -R 777/user/horton/flightdelays

(or)

as your Hadoop direcory owned by hdfs user, so sudo as hdfs and try to change the permissions on the directory

bash$ Sudo -u hdfs
bash$ hadoop fs -chmod -R 777/user/horton/flightdelays

Once you are able to change the permissions on HDFS directory then try to copy file from local to HDFS.

bash$ hadoop fs -copyFromLocal /home/horton/datasets/flightdelays/flight_delays*.csv /user/horton/flightdelays/
Highlighted

Re: HDPCD Task 01 Issue

Explorer

Thanks for help Shu. It seems this can not be done. I get follwoing message when i executed above command " cannot set permission.Name node is in safe mode.

Highlighted

Re: HDPCD Task 01 Issue

Explorer

Thanks Su. I am getting error saying. Safemode: Access denied for user root. Superuser privilege is required.

Highlighted

Re: HDPCD Task 01 Issue

Explorer

I am able to exit from safemode but when I am executing "sudo su root" its asking for password. I tried using hadoop but didnt work:(

Highlighted

Re: HDPCD Task 01 Issue

Explorer

No luck. Still asking password.