2
2

More than 5 years have passed since last update.

EMRがsparkに標準対応したのでBootStrapActionから切り替えた

Last updated at Posted at 2015-08-05

特に何も考えずに切り替えても動いたが、何故かジョブの実行時間がものすごく伸びた

調査するとbootStrapActionではspark-defaultに設定してくれていた以下の設定がaws標準だとなくなっていた

/home/hadoop/spark/conf/spark-default.sh

spark.executor.instances        5
spark.executor.cores    8
spark.executor.memory   9404M
spark.default.parallelism       40

stepを投入するスクリプトに手を入れて対応した。

STEP_ID=`aws emr add-steps --cluster-id $EMR_CLUSTER_ID --steps \
Type=CUSTOM_JAR,Name="$STEP_NAME",\
Jar=s3://ap-northeast-1.elasticmapreduce/libs/script-runner/script-runner.jar,\
Args=[\
/home/hadoop/spark/bin/spark-submit,\
--master,yarn-cluster,\
--driver-java-options,"-Dspark.akka.frameSize=128 -DXss=10m -Dspark.driver.maxResultSize=$DRIVER_MAX_RESULT_SIZE -Dspark.executor.instances=$EXECUTER_INSTANCES -Dspark.default.parallelism=$DEFAULT_PARALLELISM",\
--driver-cores,$DRIVER_CORES,\
--driver-memory,$DRIVER_MEM,\
--executor-cores,$EXECUTER_CORES,\
--executor-memory,$EXECUTER_MEM,\
--conf,spark.hadoop.validateOutputSpecs=false,\
--class,$MAIN_CLASS,\
"$JAR_NAME","$ARGS"],\
ActionOnFailure=CONTINUE --query 'StepIds[0]' --output text`
2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2