Not able to find HDFS directory on my system

0 votes

I want to copy a file from local file system to HDFS so the command I used is

hadoop dfs -copyFromLocal <local-dir> <hdfs-dir>
In this command I don't know my hdfs-dir.

I saw somewhere on internet that I should run the below command:

 hdfs dfs -ls
and I got the following output

-rw-r--r--   3 user1 hdfs  127162942 2016-04-01 19:47 .
I checked hdfs-site.xml, I found following configuration -

<property>
      <name>dfs.datanode.data.dir</name>
      <value>/hadoop/hdfs/data</value>
      <final>true</final>
</property>

I tried to run following command but it gives error -

[root@sandbox try]# hdfs dfs -copyFromLocal sample.csv /hadoop/hdfs/data
copyFromLocal: `/hadoop/hdfs/data': No such file or directory

Can anyone tell me how can I find my HDFS directory?

Apr 17, 2018 in Big Data Hadoop by coldcode
• 2,080 points
7,042 views

1 answer to this question.

0 votes

I guess you didn't understand it correctly

dfs.datanode.data.dir, is where you want to store your data blocks

If you type hdfs dfs -ls / you will get list of directories in hdfs. 

Then you can transfer files from local file system to hdfs using -copyFromLocal or -put to a particular directory or using -mkdir you can create new directory.

answered Apr 17, 2018 by nitinrawat895
• 11,380 points

Related Questions In Big Data Hadoop

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
3,458 views
0 votes
2 answers

Hadoop is not able to find jps command

jps is actually not a command of ...READ MORE

answered Apr 18, 2018 in Big Data Hadoop by Shubham
• 13,490 points
13,872 views
0 votes
1 answer

Hadoop: How to copy directory from local system to hdfs using Java code?

Just use the FileSystem's copyFromLocalFile method. If the source Path ...READ MORE

answered Nov 14, 2018 in Big Data Hadoop by Omkar
• 69,210 points
5,213 views
0 votes
1 answer

Not able to create Hive table from HDFS file

You dont have to specify the file name ...READ MORE

answered Dec 5, 2018 in Big Data Hadoop by Omkar
• 69,210 points
2,269 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,234 views
+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,523 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
103,819 views
0 votes
1 answer
0 votes
1 answer

Copy file from HDFS to the local file system

There are two possible ways to copy ...READ MORE

answered Mar 27, 2018 in Big Data Hadoop by nitinrawat895
• 11,380 points
16,392 views
+1 vote
12 answers

How to check size of HDFS directory?

It is the same syntax. Use the ...READ MORE

answered Jun 6, 2019 in Big Data Hadoop by Sowmya
45,665 views
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