【问题标题】:using terraform with EMR spark, add new step without destroying cluster使用带有 EMR spark 的 terraform,在不破坏集群的情况下添加新步骤
【发布时间】:2018-10-03 20:00:38
【问题描述】:

我正在使用 terraform 文档 (https://www.terraform.io/docs/providers/aws/r/emr_cluster.html) 来构建 EMR (spark) 集群。我正在考虑通过使用 terraform 的步骤部署 Spark 作业。

spark 提交类似于..

spark-submit --deploy-mode cluster --class mypackage.myobject s3://.../my.jar

有没有人尝试过此功能并让 terraform 在您添加新步骤或更改步骤时不破坏集群?理想情况下,影响的步骤应该是唯一被破坏和创建的东西。

【问题讨论】:

    标签: amazon-web-services apache-spark terraform


    【解决方案1】:

    简单的答案是 API 将一些操作定义为需要销毁。对此 terraform 无能为力。

    我认为这是 cloudwatch APIS 的限制。

    【讨论】:

      【解决方案2】:

      您可能需要更改生命周期 ignore_changes 属性以包含正在更改的内容

      resource "aws_emr_cluster" "example" {
        # ... other configuration ...
      
        step {
          action = "TERMINATE_CLUSTER"
          name   = "Setup Hadoop Debugging"
      
          hadoop_jar_step {
            jar  = "command-runner.jar"
            args = ["state-pusher-script"]
          }
        }
      
        # Optional: ignore outside changes to running cluster steps
        lifecycle {
          ignore_changes = ["step"]
        }
      }
      

      该代码取自示例 https://www.terraform.io/docs/providers/aws/r/emr_cluster.html#enable-debug-logging

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2018-05-05
        • 1970-01-01
        • 2021-10-22
        • 1970-01-01
        • 1970-01-01
        • 2021-03-14
        • 2019-08-25
        相关资源
        最近更新 更多