1
votes

I try to copy one file from my local system to hdfs (single node cluster) using this command:

hadoop fs -copyFromLocal /home/hduser/TestEmp.txt  /test

It gives me message like:

WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable copyFromLocal: file /test/TestEmp.txt.COPYING on client 127.0.0.1.

But when I checked in /test, I didn't find anything there.

Why?

1
This is warning message. How you are copying data,can you cross check your steps once again? - Sandeep Singh
Looks like you don't have test directory available in your hadoop file system. Can you do hdfs dfs -ls / and send the result. - Sandeep Singh
drwxr-xr-x - hduser supergroup 0 2015-05-28 16:13 /test - rinku buragohain
Run the command: hdfs namenode -format then try to copy data again. If still facing issue,share screen shot. We want to see how you are doing. - Sandeep Singh
15/05/28 16:55:14 INFO namenode.FSImage: Allocated new BlockPoolId: BP-1557757837-192.168.67.129-1432812314738 15/05/28 16:55:14 INFO common.Storage: Storage directory /tmp/hadoop-hduser/dfs/name has been successfully formatted. ************************************************************/ - rinku buragohain

1 Answers

2
votes

Make sure you have /test folder in HDFS:

hadoop fs -ls /

(OPTIONAL): If you dont have test folder in HDFS, create it using:

hadoop fs -mkdir /test

Check file permission on local filesystem:

ls -l /home/hduser/TestEmp.txt

If the file is not owned by hadoop user, change its ownership:

sudo chown hadoopusername:hadoopgroupname /home/hduser/TestEmp.txt
sudo chmod 777 /home/hduser/TestEmp.txt

Copy file into HDFS:

hadoop fs -copyFromLocal /home/hduser/TestEmp.txt  /test/

or use put command:

hadoop fs -put /home/hduser/TestEmp.txt  /test/