【问题标题】:boto3 emr client run_job_flow wants InstanceProfile attributeboto3 emr 客户端 run_job_flow 需要 InstanceProfile 属性
【发布时间】:2016-12-20 05:46:14
【问题描述】:

我正在尝试使用 boto3 来启动这样的 EMR 集群:

client = boto3.client('emr')
client.run_job_flow(**kwargs)

我收到此错误:

ClientError: An error occurred (ValidationException) when calling the
RunJobFlow operation: InstanceProfile is required for creating cluster.

(这是 Python 3.5 上的 boto3 版本 1.4.2。)

http://boto3.readthedocs.io/en/latest/reference/services/emr.html?highlight=emr#EMR.Client.run_job_flow 没有提及 InstanceProfile 属性。

我已经尝试了我的(工作)aws cli 脚本中的参数:

    --ec2-attributes '{"KeyName":"MyKeyPair",
                    "InstanceProfile":"EMR_EC2_DefaultRole",
                    "AvailabilityZone":"us-east-1c",
                    "EmrManagedSlaveSecurityGroup":"sg-7c753416",
                    "EmrManagedMasterSecurityGroup":"sg-7e753414"}'

....在 kwargs 的不同位置添加 arg,但没有运气。

谁能给我一个提示或展示一个工作示例?

任何帮助表示赞赏。

【问题讨论】:

    标签: boto3


    【解决方案1】:

    又尝试了一件事,它奏效了!

    JobFlowRole='EMR_EC2_DefaultRole'
    

    这是 client.run_job_flow() 的参数,或 **kwargs 中的顶级键。

    以下是向我展示如何操作的示例:

    http://tech.adroll.com/blog/spark/2016/01/25/spark-on-emr.html

    其他人。

    【讨论】:

    • 显然 InstanceProfile 与 JobFlowRole 是一回事。
    • 我认为我们需要JobFlowRoleServiceRole
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-11-02
    • 1970-01-01
    • 2020-10-06
    相关资源
    最近更新 更多