Why am I getting error as hdfs dfs -mkdir No such file or directory when I create a directory

0 votes

Hi I am new to hadoop and trying to create directory in hdfs called twitter_data. I have set up my vm on softlayer, installed & started hadoop successfully.

This is the commend I am trying to run:

hdfs dfs -mkdir hdfs://localhost:9000/user/Hadoop/twitter_data

And it keeps returning this error message:

 /usr/local/hadoop/etc/hadoop/hadoop-env.sh: line 2: ./hadoop-env.sh: Permission denied
16/10/19 19:07:03 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
mkdir: `hdfs://localhost:9000/user/Hadoop/twitter_data': No such file or directory

Why does it say there is no such file and directory? I am ordering it to make directory, shouldn't it just create one? I am guessing it must be the permission issue, but I cant resolve it.

Sep 10, 2018 in Big Data Hadoop by Neha
• 6,300 points
15,427 views

1 answer to this question.

0 votes

It is because the parent directories do not exist yet either. Try hdfs dfs -mkdir -p /user/Hadoop/twitter_data. The -p flag indicates that all nonexistent directories leading up to the given directory are to be created as well.

As for the question you posed in the comments, simply type into your browser http://<host name of the namenode>:<port number>/

And also I suggest you to try this as well

use the below steps command to create the directory:

1) don't run the hadoop and format the namenode:-

$ hadoop namenode -format

2) run hadoop by :-

$ start-all.sh

3)now first make the initial directory then create the another in same directory:

$ hadoop fs -mkdir /user
$ hadoop fs -mkdir /user/Hadoop
$ hadoop fs -mkdir /user/Hadoop/tweeter_data

Follow the above steps to solve the problem.

answered Sep 10, 2018 by Frankie
• 9,830 points

Related Questions In Big Data Hadoop

0 votes
1 answer
0 votes
1 answer

Not able to upload files to hdfs: No such file or directory

The reason for this error is that ...READ MORE

answered Jul 11, 2019 in Big Data Hadoop by Srujan
4,026 views
+1 vote
2 answers

What does hadoop fs -du command gives as output?

du command is used for to see ...READ MORE

answered Jul 24, 2019 in Big Data Hadoop by Lokesh Singh
5,794 views
0 votes
1 answer

How can I write text in HDFS using CMD?

Hadoop put & appendToFile only reads standard ...READ MORE

answered Apr 27, 2018 in Big Data Hadoop by Shubham
• 13,490 points
2,121 views
0 votes
1 answer

What is the command to find the free space in HDFS?

You can use dfsadmin which runs a ...READ MORE

answered Apr 29, 2018 in Big Data Hadoop by Shubham
• 13,490 points
2,079 views
0 votes
1 answer

How to find the used cache in HDFS

hdfs dfsadmin -report This command tells fs ...READ MORE

answered May 4, 2018 in Big Data Hadoop by Shubham
• 13,490 points
2,399 views
0 votes
1 answer

Hadoop Pipe: shared libraries, No such file or directory error

Add -rpath my.zip/lib to LDFLAGS_HDP. For compilation to work, you ...READ MORE

answered Aug 30, 2018 in Big Data Hadoop by Frankie
• 9,830 points
992 views
0 votes
1 answer
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