【问题标题】:How to set STEP(AWS::EMR::Step) priority in CloudFormation template如何在 CloudFormation 模板中设置 STEP(AWS::EMR::Step) 优先级
【发布时间】:2018-03-14 04:38:17
【问题描述】:

在 CloudFormation 模板中,我正在创建一个 EMR 集群,并使用 AWS::EMR::Step 资源添加了 2 个 Hive 步骤。

  1. 第一步包含 - HIVE DDL 语句
  2. 第二步包含 - HIVE DML 语句

我通过将 CloudFormation 模板传递给它来创建堆栈。但是在创建 EMR 时,很多时候第二步首先执行所有 DML 语句,但由于 DB 和表模式不存在而失败。

我想设置优先级,以便每次 HIVE DDL 步骤首先执行。 感谢您在这方面的帮助。

【问题讨论】:

    标签: amazon-cloudformation


    【解决方案1】:

    您可以在 Cloudformation 模板中使用 DependsOn 属性来订购您的 EMR 步骤:https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html

    【讨论】:

      【解决方案2】:

      不,您将无法在 EMR STEP API 上设置优先级。因此,CloudFormation 将无法拥有该功能。

      http://docs.aws.amazon.com/ElasticMapReduce/latest/API/API_RunJobFlow.html http://docs.aws.amazon.com/ElasticMapReduce/latest/API/API_StepConfig.html

      由于 HQL 脚本是按顺序运行的,您可能宁愿将 DDL 和 DML 语句放在同一个脚本中,并在一个 STEP 中运行。

      【讨论】:

        猜你喜欢
        • 2018-10-04
        • 1970-01-01
        • 1970-01-01
        • 2020-02-11
        • 2020-06-23
        • 2019-01-18
        • 1970-01-01
        • 2021-11-16
        • 2020-05-02
        相关资源
        最近更新 更多