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
146 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
• 10,030 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 6 days ago in Big Data Hadoop by Srujan
11 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,110 points
1,418 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,120 points
305 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,120 points
128 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
754 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
• 10,030 points
2,036 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
10,307 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
• 10,030 points
3,524 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,927 views