Skip to content

SPARK-1156: allow user to login into a cluster without slaves #58

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions ec2/spark_ec2.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,15 +398,13 @@ def get_existing_cluster(conn, opts, cluster_name, die_on_error=True):
if any((master_nodes, slave_nodes)):
print ("Found %d master(s), %d slaves" %
(len(master_nodes), len(slave_nodes)))
if (master_nodes != [] and slave_nodes != []) or not die_on_error:
if master_nodes != [] or not die_on_error:
return (master_nodes, slave_nodes)
else:
if master_nodes == [] and slave_nodes != []:
print "ERROR: Could not find master in group " + cluster_name + "-master"
elif master_nodes != [] and slave_nodes == []:
print "ERROR: Could not find slaves in group " + cluster_name + "-slaves"
print >> sys.stderr, "ERROR: Could not find master in group " + cluster_name + "-master"
else:
print "ERROR: Could not find any existing cluster"
print >> sys.stderr, "ERROR: Could not find any existing cluster"
sys.exit(1)


Expand Down Expand Up @@ -680,6 +678,9 @@ def real_main():
opts.zone = random.choice(conn.get_all_zones()).name

if action == "launch":
if opts.slaves <= 0:
print >> sys.stderr, "ERROR: You have to start at least 1 slave"
sys.exit(1)
if opts.resume:
(master_nodes, slave_nodes) = get_existing_cluster(
conn, opts, cluster_name)
Expand Down