1-844-696-6465 (US)        +91 77600 44484        help@dezyre.com

hadoop put file from ec2-user to hduser



0
I have a file in /home/ec2-user/pat_files that i am trying to copy in hdfs directory /home/hduser pat_hdfs using command
hadoop fs -put /home/ec2-user/pat_files /home/hduser/pat_hdfs from hduser home directory but i am getting error directory not found as shown below.

[ec2-user@ip-10-0-0-49 ~]$ ls -al
total 64
drwx------. 4 ec2-user ec2-user 4096 Feb 15 12:28 .
drwxr-xr-x. 17 root root 4096 Jan 26 04:59 ..
-rw-------. 1 ec2-user ec2-user 3759 Feb 14 00:11 .bash_history
-rw-r--r--. 1 ec2-user ec2-user 18 Jan 16 2015 .bash_logout
-rw-r--r--. 1 ec2-user ec2-user 176 Jan 16 2015 .bash_profile
-rw-r--r--. 1 ec2-user ec2-user 260 Jan 26 04:11 .bashrc
drwxrwxrwx. 2 ec2-user ec2-user 4096 Feb 15 12:29 pat_files
-rw-rw-r--. 1 ec2-user ec2-user 2539 Jan 31 21:00 pig_1454292043166.log
-rw-rw-r--. 1 ec2-user ec2-user 2539 Feb 1 22:23 pig_1454383413781.log
-rw-rw-r--. 1 ec2-user ec2-user 10713 Feb 9 06:10 pig_1455015959083.log
-rw-rw-r--. 1 ec2-user ec2-user 136 Feb 9 06:09 .pig_history
drwx------. 2 ec2-user ec2-user 4096 Jan 26 04:03 .ssh
-rw-rw-r--. 1 ec2-user ec2-user 56 Jun 14 2014 student
-rw-------. 1 ec2-user ec2-user 1112 Feb 2 07:07 .viminfo
[ec2-user@ip-10-0-0-49 ~]$ su hduser
Password:
su: incorrect password
[ec2-user@ip-10-0-0-49 ~]$ su hduser
Password:
[hduser@ip-10-0-0-49 ec2-user]$ hadoop fs -put /home/ec2-user/pat_files/* pat_hdfs
put: `/home/ec2-user/pat_files/*': No such file or directory
[hduser@ip-10-0-0-49 ec2-user]$ hadoop fs -ls
Found 5 items
drwx------ - hduser common 0 2016-01-26 13:00 .Trash
drwxr-xr-x - hduser common 0 2016-01-28 00:13 .hiveJars
drwx------ - hduser common 0 2016-02-11 03:53 .staging
drwxr-xr-x - hduser common 0 2016-01-28 00:15 abhi
drwxr-xr-x - hduser common 0 2016-02-15 12:15 pat_hdfs
[hduser@ip-10-0-0-49 ec2-user]$ hadoop fs -put /home/ec2-user/pat_files/* /home/hduser/pat_hdfs
put: `/home/hduser/pat_hdfs': No such file or directory
[hduser@ip-10-0-0-49 ec2-user]$ hadoop fs -put /home/ec2-user/pat_files/* hduser/
put: `hduser/': No such file or directory
[hduser@ip-10-0-0-49 ec2-user]$ hadoop fs -put /home/ec2-user/pat_files/Batting.csv Batting.csv
put: `/home/ec2-user/pat_files/Batting.csv': No such file or directory
[hduser@ip-10-0-0-49 ec2-user]$

3 Answer(s)


0

Hi Patrice,
Please use the correct command:
- hadoop fs -put /home/ec2-user/pat_files/* /user/hduser/pat_hdfs/

Hope this helps.
Thanks

0

Hi Abhijit, still not working. please see below:

Using username "ec2-user".
Authenticating with public key "imported-openssh-key"
Last login: Mon Feb 15 12:11:48 2016 from ool-18bafcf8.dyn.optonline.net
[ec2-user@ip-10-0-0-49 ~]$ su hduser
Password:
[hduser@ip-10-0-0-49 ec2-user]$ hadoop fs -put /home/ec2-user/pat_files/* /user/hduser/pat_hdfs/
put: `/home/ec2-user/pat_files/*': No such file or directory
[hduser@ip-10-0-0-49 ec2-user]$ hadoop fs -put /home/ec2-user/pat_files/* /user/hduser/pat_hdfs/
put: `/home/ec2-user/pat_files/*': No such file or directory
[hduser@ip-10-0-0-49 ec2-user]$

0

Hi Patrice,
I fixed the issue. Sorry for inconvenience.
Please try again. This should work.
- hadoop fs -put /home/ec2-user/pat_files/* /user/hduser/pat_hdfs/

There were permission which I resolved. You want find any difficulties now.
Please let me know if it works.
Thanks

Your Answer

Click on this code-snippet-icon icon to add code snippet.

Upload Files (Maximum image file size - 1.5 MB, other file size - 10 MB, total size - not more than 50 MB)

Email
Password