From 3ebd52a8ce5c655e133387d99ea38147cf10efff Mon Sep 17 00:00:00 2001 From: Theodore Vasiloudis Date: Thu, 5 Mar 2015 18:08:59 +0100 Subject: [PATCH 1/4] Make sure that the instance type is correct when relaunching a cluster. --- ec2/spark_ec2.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ec2/spark_ec2.py b/ec2/spark_ec2.py index c59ab565c6862..b028186bb054f 100755 --- a/ec2/spark_ec2.py +++ b/ec2/spark_ec2.py @@ -1259,6 +1259,15 @@ def real_main(): cluster_instances=(master_nodes + slave_nodes), cluster_state='ssh-ready' ) + + # Determine types of running instances + existing_master_type = master_nodes[0].instance_type + existing_slave_type = slave_nodes[0].instance_type + if existing_master_type == existing_slave_type: + existing_master_type = "" + opts.master_instance_type = existing_master_type + opts.instance_type = existing_slave_type + setup_cluster(conn, master_nodes, slave_nodes, opts, False) else: From 7b32429073b20c6b95a53b3857dddf8cb3f9690c Mon Sep 17 00:00:00 2001 From: Theodore Vasiloudis Date: Fri, 6 Mar 2015 14:19:46 +0100 Subject: [PATCH 2/4] Removed trailing whitespace --- ec2/spark_ec2.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ec2/spark_ec2.py b/ec2/spark_ec2.py index b028186bb054f..94296d8b6e2e1 100755 --- a/ec2/spark_ec2.py +++ b/ec2/spark_ec2.py @@ -1267,7 +1267,7 @@ def real_main(): existing_master_type = "" opts.master_instance_type = existing_master_type opts.instance_type = existing_slave_type - + setup_cluster(conn, master_nodes, slave_nodes, opts, False) else: From a3d29fe9309f04cea9b4615d8a9c1afa6719af94 Mon Sep 17 00:00:00 2001 From: Theodore Vasiloudis Date: Fri, 6 Mar 2015 14:25:04 +0100 Subject: [PATCH 3/4] More trailing whitespace --- ec2/spark_ec2.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ec2/spark_ec2.py b/ec2/spark_ec2.py index 94296d8b6e2e1..97ce9e96aeda8 100755 --- a/ec2/spark_ec2.py +++ b/ec2/spark_ec2.py @@ -1259,7 +1259,7 @@ def real_main(): cluster_instances=(master_nodes + slave_nodes), cluster_state='ssh-ready' ) - + # Determine types of running instances existing_master_type = master_nodes[0].instance_type existing_slave_type = slave_nodes[0].instance_type From 6705b9817e6206efddf065bf1b1d7079a8a25276 Mon Sep 17 00:00:00 2001 From: Theodore Vasiloudis Date: Mon, 9 Mar 2015 09:48:24 +0100 Subject: [PATCH 4/4] Added comment to clarify setting master instance type to the empty string. --- ec2/spark_ec2.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ec2/spark_ec2.py b/ec2/spark_ec2.py index 97ce9e96aeda8..7521aaa9344b6 100755 --- a/ec2/spark_ec2.py +++ b/ec2/spark_ec2.py @@ -1263,6 +1263,8 @@ def real_main(): # Determine types of running instances existing_master_type = master_nodes[0].instance_type existing_slave_type = slave_nodes[0].instance_type + # Setting opts.master_instance_type to the empty string indicates we + # have the same instance type for the master and the slaves if existing_master_type == existing_slave_type: existing_master_type = "" opts.master_instance_type = existing_master_type