elastic-mapreduceクラスタにaliveで起動させておいてスムーズにsshする
例えばhiveクエリを走らせて、あとからshellで入って様子を見たいとき。
$ elastic-mapreduce --create --name hoge --num-instances 1 --instance-type m1.small --plain-output --alive --hive-script --arg s3://mybucket/hive/query/hoge.q --step-name hogeTest | cut -d " " -f 4 > ./jobflowid $ elastic-mapreduce --ssh -j `cat ./jobflowid`
とすればsshしてHadoopクラスタのマスターノードにsshログインできる。
elastic-mapreduce
コマンドはここから。
- Amazon Elastic MapReduce Ruby Client : Developer Tools : Amazon Web Services
- http://aws.amazon.com/developertools/2264e
ただ、公式のはRuby v1.8にしか対応していない。Bundlerで環境を作って使ってる。以下のリポジトリだとv1.9にも対応している。
- tc/elastic-mapreduce-ruby
- https://github.com/tc/elastic-mapreduce-ruby
ただしv2.0には対応していない。aws-cliが公式にEMRもサポートしてくれるといいけど、もうちょっと時間かかりそう。2013/11/06現在、devブランチには入ってる。
- aws/aws-cli
- https://github.com/aws/aws-cli