使用boto进行弹性MapReduce - 创建集群需要InstanceProfile

时间:2015-06-01 12:35:14

标签: python amazon-web-services boto elastic-map-reduce

我尝试使用下面的代码执行弹性mapreduce作业,但是当我尝试这个时,我收到一个错误:InstanceProfile is required for creating cluster

有人知道我为什么会收到此错误?

def createmrjob(dict):  
    emr = boto.emr.connect_to_region('us-east-1')

    print ""
    print "Conected to Elastic MapReduce."

    print "Creating Streaming step"

    bucket = dict['bucket']
    print bucket
    step = StreamingStep(name='Test',
    mapper=dict['mapper'],
    reducer=dict['reducer'],
    input=msg['datafile'],
    output='s3n://'+bucket+'/uploadedfiles/')

    print "Creating job flow"
    jobid = emr.run_jobflow(name="Data Processing", 
    log_uri="s3://"+bucket+"/uploadedfiles/erm_logs/",
    steps=[step],
    num_instances = 1,
    )

createmrjob(msg)

我已经尝试使用iam创建实例配置文件:

iam.create_instance_profile("instance", path = None)

然后在弹性mapreduce作业中添加:

steps=[step],
api_params = {
      'IamInstanceProfile':'instance', 
}
)

但问题还在继续..

0 个答案:

没有答案