LoginSignup
6
5

More than 5 years have passed since last update.

AWS Elastic MapReduce CLI メモ

Last updated at Posted at 2014-10-24

AWS EMR で CLI ツールを使ってジョブを実行するメモ。AWS 自体の CLI ツールもあるけど、EMR は別になっている。そのうちサポートされるらしいですが……。

UPDATE: もうサポートされてました。この記事はobsoleteです。

  • クラスタの起動
$ elastic-mapreduce --create --alive \
  --name CLUSTER-NAME \
  --instance-group master --instance-type m3.xlarge --instance-count 1 \
  --instance-group core --instance-type m3.xlarge --instance-count 10

起動すると jobflow ID を教えてくれる。--alive を指定した場合ユーザが明示的に terminate するまで死なないので注意。

  • 各ステップの設定を書いた config ファイル
[
  {
    "Name": "STEP NAME",
    "ActionOnFailure": "CONTINUE",
    "HadoopJarStep": {
      "Jar": "s3://***",
      "Args": [   ]
    }
  },
  {
    "Name": "STEP NAME",
    "ActionOnFailure": "CONTINUE",
    "HadoopJarStep": {
      "Jar": "s3://***",
      "Args": [   ]
    }
  }
]
  • ステップの実行
$ elastic-mapreduce --jobflow JOBFLOW-ID --json CONFIG.json

クラスタが死なない限り追加できる(?)

  • クラスタの起動時に各ステップも指定する場合
$ elastic-mapreduce --create \
  --name CLUSTER-NAME \
  --instance-group master --instance-type m3.xlarge --instance-count 1 \
  --instance-group core --instance-type m3.xlarge --instance-count 10 \
  --json CONFIG.json

--alive をつけていないのでこの場合ジョブが終わったらクラスタも終了する。

6
5
2

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
6
5