crystyxn
crystyxn

Reputation: 1601

HDFS put: no such file or directory even though the file is there

I am trying to upload a file in HDFS with:

sudo -u hdfs hdfs dfs -put /home/hive/warehouse/sample.csv hdfs://[ip_redacted]:9000/data

I can confirm that HDFS works, as I managed to create the /data directory just fine.

Even giving the full path to the .csv file gives the same error:

put: `/home/hive/warehouse/sample.csv': No such file or directory

Why is it giving this error?

Upvotes: 1

Views: 1951

Answers (2)

luzhe
luzhe

Reputation: 38

I encountered the problem, too.

Because user hdfs has no permission to access one of the file's ancestry directories, so it gave the error No such file or directory.

As crystyxn commentted, using environment variable HADOOP_USER_NAME instead of sudo -u hdfs worked.

Upvotes: 1

Tsvetelina Mariyanova
Tsvetelina Mariyanova

Reputation: 359

Is the csv file in your local system or in HDFS? You can use -put command (or the -copyFromLocal command) ONLY to move a LOCAL file into the distributed file system.

Upvotes: 0

Related Questions