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,260 points
1,067 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,810 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 5 days ago in Big Data Hadoop by Srujan
11 views
0 votes
1 answer

Getting error in command hdfs dfs -mkdir

You are getting this error because the ...READ MORE

answered Apr 15, 2018 in Big Data Hadoop by Shubham
• 13,110 points
381 views
0 votes
1 answer

What does hadoop fs -du command gives as output?

The first value is the size of ...READ MORE

answered Apr 27, 2018 in Big Data Hadoop by Shubham
• 13,110 points
628 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,110 points
61 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,110 points
118 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,110 points
160 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,810 points
41 views
0 votes
1 answer