Skip to content
Open
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: 10 additions & 1 deletion ec2/spark_ec2.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class UsageError(Exception):
# Configure and parse our command-line arguments
def parse_args():
parser = OptionParser(usage="spark-ec2 [options] <action> <cluster_name>"
+ "\n\n<action> can be: launch, destroy, login, stop, start, get-master",
+ "\n\n<action> can be: launch, destroy, login, stop, start, get-master, get-slaves",
add_help_option=False)
parser.add_option("-h", "--help", action="help",
help="Show this help message and exit")
Expand Down Expand Up @@ -761,6 +761,15 @@ def real_main():
(master_nodes, slave_nodes) = get_existing_cluster(conn, opts, cluster_name)
print master_nodes[0].public_dns_name

elif action == "get-slaves":
(master_nodes, slave_nodes) = get_existing_cluster(conn, opts, cluster_name)

for slave in slave_nodes:
if not slave.public_dns_name and not opts.private_ips:
print("Slave has no public DNS name. Maybe you meant to specify --private-ips?")
else:
print(get_dns_name(slave, opts.private_ips))

elif action == "stop":
response = raw_input("Are you sure you want to stop the cluster " +
cluster_name + "?\nDATA ON EPHEMERAL DISKS WILL BE LOST, " +
Expand Down