Getting error in command hdfs dfs -mkdir

0 votes

I have just started learning Hadoop & had setup my own VM. I am learning basic commands. One of the basic command is to create a directory ully.

I am trying to create a test directory in HDFS.

hdfs dfs -mkdir hdfs://localhost:9000/usr/hadoop/test

I am getting the following error message:

/usr/lib/hadoop/etc/hadoop/hadoop-env.sh: line 2: ./hadoop-env.sh: Permission denied

11/6/17 12:08:02 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable

mkdir: `hdfs://localhost:9000/usr/hadoop/test': No such file or directory

I am creating a directory but the error is saying that the directory is not there. I think this has something to do with the permissions. Can someone help me out?

Apr 15, 2018 in Big Data Hadoop by coldcode
• 2,080 points
2,801 views

1 answer to this question.

0 votes
You are getting this error because the parent directory which you are referring i.e. /usr/Hadoop doesn’t exist. So hdfs is not able to create this directory. You can go to localhost:9000 in your web browser to check this. You can use this command to create the parent as well as target directory.
 

hdfs dfs -mkdir -p hdfs://localhost:9000/usr/hadoop/test
answered Apr 15, 2018 by Shubham
• 13,490 points

Related Questions In Big Data Hadoop

0 votes
1 answer
0 votes
1 answer

Issue in hdfs dfs command

Hadoop has a special file system called ...READ MORE

answered Jan 7, 2019 in Big Data Hadoop by Omkar
• 69,210 points
918 views
0 votes
1 answer
+1 vote
1 answer

Hadoop Mapreduce word count Program

Firstly you need to understand the concept ...READ MORE

answered Mar 16, 2018 in Data Analytics by nitinrawat895
• 11,380 points
10,558 views
+2 votes
11 answers

hadoop fs -put command?

Hi, You can create one directory in HDFS ...READ MORE

answered Mar 16, 2018 in Big Data Hadoop by nitinrawat895
• 11,380 points
104,213 views
–1 vote
1 answer

Hadoop dfs -ls command?

In your case there is no difference ...READ MORE

answered Mar 16, 2018 in Big Data Hadoop by kurt_cobain
• 9,390 points
4,260 views
0 votes
1 answer
+1 vote
1 answer
0 votes
5 answers
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP