创建 Amazon S3 存储桶后,my_bucket
,我通过 cli 创建了一个 Elastic Map Reduce 集群:
aws emr create-cluster --name "Hive testing" --ami-version 3.3 --applications Name=Hive --use-default-roles --instance-type m3.xlarge --instance-count 3 --steps Type=Hive,Name="Hive Program",Args=[-d,INPUT=s3://my_bucket/input,-d.OUTPUT=s3://my_bucket/input,-d-LIBS=s3://my_bucket/serde_libs]
请注意,我没有指定
hive
*.q 文件。做完S3和EMR集群后,登录EMR盒子,然后运行hive
交互地。注意 - 我假设有一个可以登录的 EMR 框。
然而,当我跑
aws emr describe-cluster --cluster-id XYZ
,我在输出中看到了这个错误: "State": "TERMINATED_WITH_ERRORS",
"StateChangeReason": {
"Message": "EMR service role arn:aws:iam::xyz:role/EMR_DefaultRole
is invalid",
"Code": "VALIDATION_ERROR"
}
什么会导致这个错误?我是否需要为 EMR 集群打开 S3 存储桶的权限才能访问它?
最佳答案
问题不在于存储桶,而在于缺少预期的 IAM 角色。
见 http://docs.aws.amazon.com/ElasticMapReduce/latest/DeveloperGuide/emr-iam-roles-creatingroles.html#emr-iam-roles-createdefaultwithcli
发出 AWS CLI 命令:
aws emr create-default-roles
然后再次创建集群。这是创建默认角色所需的一次性步骤。
小心使用最新版本的 aws cli,我在使用 1.4(debian jessie 包)时遇到问题
instance profile and service role are required for accounts created after April 6, 2015, and will eventually be required for all accounts
关于amazon-web-services - `EMR service role is invalid` 创建EMR集群时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27953582/