0

我想问一下目前是否可以使用 spark-ec2 脚本https://spark.apache.org/docs/latest/ec2-scripts.html以及不仅来自:aws_access_key_id和的凭据aws_secret_access_key,而且还包含aws_security_token.

当我尝试运行脚本时,我收到以下错误消息:

ERROR:boto:Caught exception reading instance data
Traceback (most recent call last):
File "/Users/zikes/opensource/spark/ec2/lib/boto-2.34.0/boto/utils.py", line 210, in retry_url
r = opener.open(req, timeout=timeout)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 404, in open
response = self._open(req, data)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 422, in _open
'_open', req)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 382, in _call_chain
result = func(*args)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 1214, in http_open
return self.do_open(httplib.HTTPConnection, req)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 1184, in do_open
raise URLError(err)
URLError: <urlopen error [Errno 64] Host is down>
ERROR:boto:Unable to read instance data, giving up
No handler was ready to authenticate. 1 handlers were checked. ['QuerySignatureV2AuthHandler'] Check your credentials

有谁知道什么可能是错的?是aws_security_token问题吗?在我看来,这可能比 Spark 问题更像 boto。

我都试过了:

~/.aws/credentials1) 在和中设置凭据~/.aws/config

2)通过命令设置凭证:

export aws_access_key_id=<my_aws_access_key>
export aws_secret_access_key=<my_aws_seecret_key>
export aws_security_token=<my_aws_security_token>

我的启动命令是:

./spark-ec2 -k my_key -i my_key.pem --additional-tags "mytag:tag1,mytag2:tag2" --instance-profile-name "profile1" -s 1 launch test
4

2 回答 2

0

您可以使用命令设置您的凭据和配置aws configure。我遇到了同样的问题,但在我的情况下,我的 AWS_SECRET_ACCESS_KEY 有一个斜线,我重新生成了密钥,直到没有斜线并且它起作用了

于 2015-07-28T18:06:50.837 回答
0

问题是我没有使用default重命名后调用的配置文件一切正常。

于 2015-08-03T15:23:00.613 回答