aboutsummaryrefslogtreecommitdiff
path: root/ec2
diff options
context:
space:
mode:
authorXiangrui Meng <meng@databricks.com>2014-02-18 18:30:02 -0800
committerReynold Xin <rxin@apache.org>2014-02-18 18:30:02 -0800
commitb61435c7ff620a05bee65607aed249541ab54b13 (patch)
tree88287545f16dc3357d00bc164c8af22ac2b44fc0 /ec2
parentd9bb32a790e76e35f32229082648f97170ffef07 (diff)
downloadspark-b61435c7ff620a05bee65607aed249541ab54b13.tar.gz
spark-b61435c7ff620a05bee65607aed249541ab54b13.tar.bz2
spark-b61435c7ff620a05bee65607aed249541ab54b13.zip
SPARK-1106: check key name and identity file before launch a cluster
I launched an EC2 cluster without providing a key name and an identity file. The error showed up after two minutes. It would be good to check those options before launch, given the fact that EC2 billing rounds up to hours. JIRA: https://spark-project.atlassian.net/browse/SPARK-1106 Author: Xiangrui Meng <meng@databricks.com> Closes #617 from mengxr/ec2 and squashes the following commits: 2dfb316 [Xiangrui Meng] check key name and identity file before launch a cluster
Diffstat (limited to 'ec2')
-rwxr-xr-xec2/spark_ec2.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/ec2/spark_ec2.py b/ec2/spark_ec2.py
index e88f80aa62..b0512ca891 100755
--- a/ec2/spark_ec2.py
+++ b/ec2/spark_ec2.py
@@ -218,6 +218,12 @@ def get_spark_ami(opts):
# Returns a tuple of EC2 reservation objects for the master and slaves
# Fails if there already instances running in the cluster's groups.
def launch_cluster(conn, opts, cluster_name):
+ if opts.identity_file is None:
+ print >> stderr, "ERROR: Must provide an identity file (-i) for ssh connections."
+ sys.exit(1)
+ if opts.key_pair is None:
+ print >> stderr, "ERROR: Must provide a key pair name (-k) to use on instances."
+ sys.exit(1)
print "Setting up security groups..."
master_group = get_or_make_group(conn, cluster_name + "-master")
slave_group = get_or_make_group(conn, cluster_name + "-slaves")