Я использую инструмент CLI (от apache spark), который под ним использует boto. Хотя я уже подтвердил, что
AWS_ACCESS_KEY
AWS_SECRET_KEY
являются правильными (посредством ec2-describe-regions
), авторизация все еще терпит неудачу:
ec2/spark-ec2 -k mykey --copy -s 5 -i ~/.ssh/mykey.pem -t c3.2xlarge
-z us-east-1a -r us-east-1 launch mycluster
Обратите внимание на последнюю ошибку после трассировки стека:
<Response><Errors><Error><Code>AuthFailure</Code><Message>AWS was not able to
validate the provided access credentials</Message></Error></Errors>
Вот полный вывод:
Setting up security groups...
ERROR:boto:401 Unauthorized
ERROR:boto:<?xml version="1.0" encoding="UTF-8"?>
<Response><Errors><Error><Code>AuthFailure</Code><Message>AWS was not able to validate the provided access credentials</Message></Error></Errors><RequestID>f960cab0-bfe6-4939-913c-5fbc0bf8662f</RequestID></Response>
Traceback (most recent call last):
File "ec2/spark_ec2.py", line 1509, in <module>
main()
File "ec2/spark_ec2.py", line 1501, in main
real_main()
File "ec2/spark_ec2.py", line 1330, in real_main
(master_nodes, slave_nodes) = launch_cluster(conn, opts, cluster_name)
File "ec2/spark_ec2.py", line 482, in launch_cluster
master_group = get_or_make_group(conn, cluster_name + "-master", opts.vpc_id)
File "ec2/spark_ec2.py", line 343, in get_or_make_group
groups = conn.get_all_security_groups()
File "/shared/sparkup2/ec2/lib/boto-2.34.0/boto/ec2/connection.py", line 2969, in get_all_security_groups
[('item', SecurityGroup)], verb='POST')
File "/shared/sparkup2/ec2/lib/boto-2.34.0/boto/connection.py", line 1182, in get_list
raise self.ResponseError(response.status, response.reason, body)
boto.exception.EC2ResponseError: EC2ResponseError: 401 Unauthorized
<?xml version="1.0" encoding="UTF-8"?>
<Response><Errors><Error><Code>AuthFailure</Code><Message>AWS was not able to
validate the provided access credentials</Message></Error></Errors>