【发布时间】:2018-08-14 13:09:07
【问题描述】:
我正在尝试使用以下脚本在 EC2 上启动 Spark 集群:
spark-ec2/spark-ec2 -k keyfile.pem --identity-file=keyfile.pem --region=us-west-2 --zone=us-west-2a --copy-aws-credentials --instance-type t2.micro --worker-instances 1 launch pg-hello-cluster
我在哪里配置了变量:
export AWS_SECRET_ACCESS_KEY=xxx
export AWS_ACCESS_KEY_ID=xxx
这会引发以下错误,这似乎是urllib2 库的问题?
- Downloading boto...
Traceback (most recent call last):
File "spark-ec2/spark_ec2.py", line 169, in <module>
setup_external_libs(external_libs)
File "spark-ec2/spark_ec2.py", line 143, in setup_external_libs
lib_version=lib["version"]
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 154, in urlopen
return opener.open(url, data, timeout)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 431, in open
response = self._open(req, data)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 449, in _open
'_open', req)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 409, in _call_chain
result = func(*args)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 1240, in https_open
context=self._context)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 1197, in do_open
raise URLError(err)
urllib2.URLError: <urlopen error [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:590)>
感谢任何帮助!
【问题讨论】:
-
仔细检查您的 Python 版本链接到的 OpenSSL 版本。它可能太旧了。注意:T2.micro 对于 Spark 来说太小了。建议的最低容量为 8 GB - 最低容量为 2 GB。
-
谢谢!更新 openSSL 版本修复了之前的错误。但是现在,invalidKeypairs 出现错误
ERROR:boto:400 Bad Request ERROR:boto:<?xml version="1.0" encoding="UTF-8"?> <Response><Errors><Error><Code>InvalidKeyPair.NotFound</Code><Message>The key pair 'gutenberg-project.pem' does not exist</Message></Error></Errors><RequestID>ba9d906b-ee28-4e74-8bef-9c731fd3a49e</RequestID></Response> -
显然这是由于区域不匹配而发生的,尝试过但没有奏效。让我看看我还能做什么
-
问题是您使用 -k 文件名,而您应该使用密钥对名称。在 AWS EC2 控制台中查找。 AND 密钥对是特定于区域的。
标签: python-2.7 amazon-web-services apache-spark amazon-ec2