【问题标题】:When does EMR bootstrap actions runEMR 引导操作何时运行
【发布时间】:2016-09-08 22:35:06
【问题描述】:

我正在创建一个 AWS 集群,并且我有一个引导操作来更改 spark-defaults.conf。

服务器不断被终止说

无法读取 /etc/spark/conf/spark-defaults.conf:没有这样的文件或 目录

如果我跳过这个并在服务器上检查文件确实存在。所以我认为事情的顺序不正确。我使用的是 EMR 4.5 提供的 Spark 1.6.1,所以它应该默认安装。

有什么线索吗?

谢谢!

【问题讨论】:

    标签: hadoop amazon-web-services apache-spark pyspark


    【解决方案1】:

    您不应在引导操作中更改 Spark 配置。相反,您应该在启动集群时需要添加的特殊 json 文件中指定对 spark-defaults 的任何更改。如果您使用cli 启动,该命令应如下所示:

     aws --profile MY_PROFILE emr create-cluster \
     --release-label emr-4.6.0 \
     --applications Name=Spark Name=Ganglia Name=Zeppelin-Sandbox \
     --name "Name of my cluster" \
     --configurations file:///path/to/my/emr-configuration.json \
     ...
     --bootstrap-actions ....
     --step ...
    

    然后在emr-configuration.json 文件中将更改设置为spark-defaults。一个例子可能是:

    [
      {
        "Classification": "capacity-scheduler",
        "Properties": {
          "yarn.scheduler.capacity.resource-calculator": "org.apache.hadoop.yarn.util.resource.DominantResourceCalculator"
        }
      },
      {
        "Classification": "spark",
        "Properties": {
          "maximizeResourceAllocation": "true"
        }
      },
      {
        "Classification": "spark-defaults",
        "Properties": {
          "spark.dynamicAllocation.enabled": "true",
          "spark.executor.cores":"7"
        }
      }
    ]
    

    【讨论】:

    • 不幸的是,EMR JSON 配置不支持所有 spark 配置选项。如果您需要更改 spark.driver.extraClassPath 或 spark.executor.extraClassPath 等内容,JSON 不允许您这样做。如果不使用引导操作,您将如何更改这些选项?
    • @Drahkar 我不知道 spark.xx.extraClassPath 不能通过配置文件设置,但我认为您仍然可以将它们指定为您的步骤的选项,例如 --steps Name=MyJob,Type=Spark,Args=[--master,yarn-client,--conf,spark.driver.extraClassPath=/extra/class/path/...]??
    【解决方案2】:

    实现此目标的最佳方式是在 CloudFormation 模板中使用 Steps 定义,例如...因为 Steps 将特别在包含 spark-default.conf 文件的主节点上运行。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-02-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-09-12
      • 2015-01-02
      • 1970-01-01
      相关资源
      最近更新 更多