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,010 points
129 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
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
• 9,610 points

Related Questions In Big Data Hadoop

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
• 12,890 points
1,307 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
• 67,000 points
248 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
• 67,000 points
101 views
0 votes
1 answer

Not able to run hdfs commands

Because you said it ran yesterday and ...READ MORE

answered Jan 3 in Big Data Hadoop by Omkar
• 67,000 points
74 views
0 votes
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,240 points
675 views
0 votes
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
• 9,610 points
1,872 views
0 votes
10 answers

hadoop fs -put command?

copy command can be used to copy files ...READ MORE

answered Dec 7, 2018 in Big Data Hadoop by Sujay
9,350 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
• 9,610 points
3,147 views
0 votes
11 answers

How to check size of HDFS directory?

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

answered Jun 6 in Big Data Hadoop by Sowmya
5,249 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.