简体   繁体   English

将文件从s3://复制到本地(hadoop)文件系统时出现错误

[英]Getting error when copying file from s3:// to local(hadoop) file system

I am trying to copy the files from s3 to hadoop file system using python. 我正在尝试使用python将文件从s3复制到hadoop文件系统。 I got the following error: 我收到以下错误:

cp: `foo/ds=2015-02-13/ip-d1b-request-2015-02-13_10-00_10-09.txt.gz': No such file or directory

I am recently migrating latest hadoop version(2.4.0). 我最近正在迁移最新的hadoop版本(2.4.0)。 In version(0.20) is working fine. 在版本(0.20)中工作正常。 Why I m getting this error in the 2.4.0 version? 为什么在2.4.0版本中出现此错误?

In Hadoop version 0.20 在Hadoop 0.20版中

hadoop@ip-10-76-38-167:~$ /home/hadoop/bin/hadoop fs -cp s3://test.com/foo/ds=2015-02-13/ip-d1b-request-2015-02-13_10-00_10-09.txt.gz /foo/ds=2015-02-13/ip-d1b-request-2015-02-13_10-00_10-09.txt.gz

15/02/13 11:21:45 INFO s3native.NativeS3FileSystem: Opening 's3://test.com/foo/ds=2015-02-13/ip-d1b-request-2015-02-13_10-00_10-09.txt.gz' for reading

In Hadoop version 2.4.0 在Hadoop版本2.4.0中

[hadoop@ip-10-169-19-123 ~]$ /home/hadoop/bin/hadoop fs -cp s3://test.com/foo/ds=2015-02-13/ip-d1b-request-2015-02-13_10-00_10-09.txt.gz /foo/ds=2015-02-13/ip-d1b-request-2015-02-13_10-00_10-09.txt.gz

15/02/13 11:21:37 INFO guice.EmrFSBaseModule: Consistency disabled, using com.amazon.ws.emr.hadoop.fs.s3n.S3NativeFileSystem as FileSystem implementation.

15/02/13 11:21:38 INFO fs.EmrFileSystem: Using com.amazon.ws.emr.hadoop.fs.s3n.S3NativeFileSystem as filesystem implementation

cp: `foo/ds=2015-02-13/ip-d1b-request-2015-02-13_10-00_10-09.txt.gz': No such file or directory

You need to try like this . 您需要这样尝试。 Add " 添加“

/home/hadoop/bin/hadoop fs -cp "s3://test.com/foo/ds=2015-02-13/ip-d1b-request-2015-02-13_10-00_10-09.txt.gz" "/foo/ds=2015-02-13/ip-d1b-request-2015-02-13_10-00_10-09.txt.gz"

I found the answer my own. 我找到了自己的答案。

Using `distcp` instead of `fs -cp`.

This command works without any issues. 该命令可以正常工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM