【问题标题】:When using the R package Segue to connect to EMR I receive an S3 404 error使用 R 包 Segue 连接到 EMR 时,我收到 S3 404 错误
【发布时间】:2013-10-30 17:55:18
【问题描述】:

我正在尝试使用简单的包 Segue (https://code.google.com/p/segue) 在 EMR 上运行我的 R 代码。

我可以连接,但是当我尝试执行功能时,我收到与 S3 相关的 404 错误(如下)。任何人都可以推测这意味着什么或我可以如何解决它?我不了解 S3,也很少有 EMR 经验。

谢谢!!

#Setup R Environment
setwd("/home/jmiller/") 
install.packages("rJava")
install.packages("caTools")
install.packages("segue_0.05.tar.gz", repos = NULL, type="source")
install.packages("Matching")
library(rJava)
library(caTools)
library(segue)
library(Matching)

#Import raw data
data <- read.delim("STUFF GOES HERE ")

#Write the Function  
jdm <- function (data) {STUFF GOES HERE }

#Setup EMR
setCredentials("STUFF GOES HERE ", "STUFF GOES HERE ") 
> emr.test <- createCluster(numInstances=2 )
STARTING - 2013-10-30 13:50:33
STARTING - 2013-10-30 13:51:05
STARTING - 2013-10-30 13:51:36
STARTING - 2013-10-30 13:52:07
STARTING - 2013-10-30 13:52:38
BOOTSTRAPPING - 2013-10-30 13:53:09
BOOTSTRAPPING - 2013-10-30 13:53:40
BOOTSTRAPPING - 2013-10-30 13:54:12
WAITING - 2013-10-30 13:54:43
Your Amazon EMR Hadoop Cluster is ready for action. 
Remember to terminate your cluster with stopCluster().
Amazon is billing you!

> emr.result <- emrlapply(emr.test, data, jdm, taskTimeout=10)
Error in .jcall("RJavaTools", "Ljava/lang/Object;", "invokeMethod", cl,  : 
  Status Code: 404, AWS Service: Amazon S3, AWS Request ID: F39B3FDE8682AF39, AWS   Error Code: NoSuchBucket, AWS Error Message: The specified bucket does not exist, S3 Extended Request ID: g9XDhofkpgux2/mBR4t8FhY3u9G85ZxsvXZkr1SZ2a0bA871LJKNSqtgeAfaFEG0

> stopCluster(emr.test)

因此,在关闭该集群后,我启动了另一个集群并尝试运行 Jeff Breen 的示例。令我惊讶的是,它实际上在我的第一次尝试中起作用。

outputEmr

但是然后我尝试在同一个集群上使用我自己的函数,但它失败并显示与之前相同的错误消息并且那时我删除了示例并再次尝试。这再次产生了相同的 404 错误消息。

outputEmr

所以我关闭了集群并启动了另一个,再次只运行示例代码。这又给了我404错误。我又试了 2 次,还是一样的错误。

我从 Segue Google 小组得到的理解是,作者 JD Long 知道另外几个用户和我自己也遇到了这个问题,他正在调查这个问题,但目前我们不知道是什么问题或如何修复它。 .

【问题讨论】:

    标签: r amazon-web-services amazon-s3 segue emr


    【解决方案1】:

    HTTP 404 表示 AWS 连接字符串不正确。很难判断您提供的连接网址。

    我在 Jeffrey Breen 的示例中看到了这些行,但在您的代码中没有:

    > library(segue)
    Loading required package: rJava
    Loading required package: caTools
    Loading required package: bitops
    Segue did not find your AWS credentials. Please run the setCredentials() function.
    
    > setCredentials('YOUR_ACCESS_KEY_ID', 'YOUR_SECRET_ACCESS_KEY')
    
    > myCluster <- createCluster(numInstances=5)
    

    http://pcsupport.about.com/od/findbyerrormessage/a/404error.htm

    http://cran.r-project.org/web/views/HighPerformanceComputing.html

    http://jeffreybreen.wordpress.com/2011/01/10/segue-r-to-amazon-elastic-mapreduce-hadoop/

    【讨论】:

    • 谢谢。幸运的是,我确实成功地连接了我的 AWS 凭证并加载了所需的包。我会用它来更新主帖。虽然您会看到我自己加载了一些包,但它们也在 Segue 包的源代码中加载。
    猜你喜欢
    • 1970-01-01
    • 2013-09-14
    • 1970-01-01
    • 2021-09-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-01-10
    • 1970-01-01
    相关资源
    最近更新 更多