【问题标题】:Glue Job failing due to Amazon S3 timeoutGlue 作业因 Amazon S3 超时而失败
【发布时间】:2018-05-21 15:27:41
【问题描述】:

我一直在学习 AWS 胶水教程 (https://docs.aws.amazon.com/glue/latest/dg/getting-started.html),现在我正在尝试配置我的第一份工作,旨在将 RDS 表中的所有数据复制到 S3 上的 parquet 文件中。

我成功了:

  • 创建了 S3 VPC 端点
  • 创建了胶水 RDS 连接和爬虫
  • 已成功将 RDS 表元数据添加到目录中。

创建我的工作:

  • 从胶水仪表板中选择了“添加作业”
  • 给作业一个名称,分配用于上述 RDS 连接的相同 ROLE(因为它分配了 AWSGlueServiceRole 策略),选择“AWS Glue 生成的建议脚本”并将其他字段保留为默认值。
  • 从目录中选择所需的 RDS 表作为源 对于输出选择“在数据目标中创建表”,使用 s3 作为数据源,parquet 作为格式,作为目标选择新创建的输出 s3 文件夹 - 'aws-glue-test-etl/data'
  • 单击“下一步”后,我将所有字段映射保留为默认设置。
  • 保存作业并编辑脚本

当我使用默认值运行作业时,我得到以下日志输出:

--conf spark.hadoop.yarn.resourcemanager.connect.max-wait.ms=60000 --conf spark.hadoop.fs.defaultFS=hdfs://ip-10-0-1-88.eu-west-1.compute.internal:8020 --conf spark.hadoop.yarn.resourcemanager.address=ip-10-0-1-88.eu-west-1.compute.internal:8032 --conf spark.dynamicAllocation.enabled=true --conf spark.shuffle.service.enabled=true --conf spark.dynamicAllocation.minExecutors=1 --conf spark.dynamicAllocation.maxExecutors=18 --conf spark.executor.memory=5g --conf spark.executor.cores=4 --JOB_ID j_20380e2f5d565a53d8bd397904dd210cbca826f3825ae8ff6b5a23e8f7bca45d --JOB_RUN_ID jr_6d60e2930a43a06edf6b6e8307171e88bd754ac5f9e66f2eaf5373e570b61280 --scriptLocation s3://aws-glue-scripts-558091818291-eu-west-1/MarcFletcher/UpdateAccountsExport-py --job-bookmark-option job-bookmark-disable --job-language python --TempDir s3://aws-glue-temporary-558091818291-eu-west-1/MarcFletcher --JOB_NAME UpdateAccountsExport-py

YARN_RM_DNS=ip-10-0-1-88.eu-west-1.compute.internal

Detected region eu-west-1

JOB_NAME = UpdateAccountsExport-py

Specifying eu-west-1 while copying script.

S3 copy with region specified failed. Falling back to not specifying region.

还有如下错误输出:

fatal error: HTTPSConnectionPool(host='aws-glue-scripts-558091818291-eu-west-1.s3.eu-west-1.amazonaws.com', port=443): Max retries exceeded with url: /MarcFletcher/UpdateAccountsExport-py (Caused by ConnectTimeoutError(<botocore.awsrequest.AWSHTTPSConnection object at 0x7f9b11afbf10>, 'Connection to aws-glue-scripts-558091818291-eu-west-1.s3.eu-west-1.amazonaws.com timed out. (connect timeout=60)'))

Error downloading script: fatal error: HTTPSConnectionPool(host='aws-glue-scripts-558091818291-eu-west-1.s3.eu-west-1.amazonaws.com', port=443): Max retries exceeded with url: /MarcFletcher/UpdateAccountsExport-py (Caused by ConnectTimeoutError(<botocore.awsrequest.AWSHTTPSConnection object at 0x7fe752548f10>, 'Connection to aws-glue-scripts-558091818291-eu-west-1.s3.eu-west-1.amazonaws.com timed out. (connect timeout=60)'))

我已查看故障排除指南 (https://docs.aws.amazon.com/glue/latest/dg/glue-troubleshooting-errors.html),但未在其中找到任何潜在的解决方案。自动选择的区域 eu-west-1 是正确的。

如果有人能指出工作出错的地方,将不胜感激。

【问题讨论】:

  • 我遇到了类似的问题,我将使用我的业务支持合同尝试让 AWS 工程师提供答案。一旦我们找到解决方案,我会在这里发布更新。
  • @bradcosine 你运气好吗?

标签: amazon-web-services aws-glue


【解决方案1】:

很可能是安全组端口阻塞问题。

检查附加到粘合连接的 AWS 安全组出口规则,允许所有 443 端口上的 TCP

【讨论】:

    【解决方案2】:

    如果禁用增强型 VPC 路由,请签入 Redshift。

    打开 Redshift 集群 -> 属性/网络和安全设置/编辑和禁用增强型 VPC 路由

    AWS:“启用此选项会强制您的集群和数据存储库之间的网络流量通过 VPC 而不是互联网”

    【讨论】:

      【解决方案3】:

      在子网路由表中有一个 S3 端点很重要。

      https://docs.aws.amazon.com/glue/latest/dg/start-development-endpoint.html https://github.com/awsdocs/aws-glue-developer-guide/blob/master/doc_source/vpc-endpoints-s3.md

      尽管如此,我还发现在设置 boto3 资源时需要指定区域。

      我找不到这个或相关的 boto.config 文档。

      s3 = boto3.resource('s3', 'ap-southeast-2')
      file = s3.Object('bucket_name', 'file_key.txt')
      file_contents = file.get()['Body'].read()
      

      【讨论】:

        【解决方案4】:

        一旦您的 VPC 端点设置完毕,请务必记住它是can only route traffic within a single AWS region。这意味着您尝试访问的 S3 存储桶必须与您的 AWS Glue 相关资源(尤其是您的 S3 VPC 终端节点)在同一区域中创建。

        【讨论】:

        • 我已经在 OP 中提到,已经创建了 S3 VPC 端点。
        • 对不起,我错过了你的问题。我已经更新了我的答案,而不是删除它,因为相同区域的部分仍然对某人有用。
        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2012-12-16
        • 2021-12-23
        • 2018-01-30
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2017-03-16
        相关资源
        最近更新 更多