【问题标题】:Assign Role to AWS EC2 Cluster via spark script通过 spark 脚本将角色分配给 AWS EC2 集群
【发布时间】:2016-06-15 18:11:39
【问题描述】:

我无法通过 spark 脚本 spark/ec2/spark-ec2 为 ec2 集群分配角色。我使用以下命令启动集群: 其中 myprofile 是具有足够权限的测试配置文件。

./spark-ec2 -k <key name> -i <aws .pem file> -s 2  -r eu-west-1 launch mycluster --instance-type=m4.large --instance-profile-name=myprofile

我可以在 ec2 控制台中看到它们也分配了正确角色的实例。 然后我继续通过 ssh 进入主实例:

./spark-ec2 -k <key name>  -i <aws .pem file> login mycluster

curl http://169.254.169.254/latest/meta-data/iam/security-credentials/myprofile

我可以查看我的临时安全密钥、访问密钥和安全令牌。但是,运行

aws s3 list-buckets

返回

"Message": "The AWS Access Key Id you provided does not exist in our records."

通过 curl 命令检索密钥并将它们传递给 boto 也不起作用,给出“403 权限被拒绝”..

我错过了什么吗?

请看下面这个非常相似的问题。但由于我不允许在那里发表评论,我也没有答案,所以我提出了一个新问题。也许有人可以通过指向我的问题的链接向那个人发表评论。谢谢。

Running Spark EC2 scripts with IAM role

【问题讨论】:

    标签: apache-spark amazon-ec2


    【解决方案1】:

    好的,我有这个问题 3 天,现在我在发布问题后直接解决了......做:

    sudo yum update
    

    将更新 aws cli,之后角色似乎可以工作。 我什至可以在 python 中做:

    from boto.s3.connection import S3Connection
    conn = S3Connection()
    bucket = conn.get_bucket('my_bucket')
    keys = bucket.list()
    

    【讨论】:

      猜你喜欢
      • 2022-01-01
      • 1970-01-01
      • 2017-08-28
      • 1970-01-01
      • 2015-04-12
      • 1970-01-01
      • 2020-10-27
      • 2023-03-22
      相关资源
      最近更新 更多