コード例 #1
0
ファイル: director.py プロジェクト: ryan-williams/eggo
def describe(region, stack_name):
    ec2_conn = create_ec2_connection(region)
    print "Launcher", get_launcher_instance(ec2_conn, stack_name).ip_address
    print "Manager", get_manager_instance(ec2_conn, stack_name).ip_address
    print "Master", get_master_instance(ec2_conn, stack_name).ip_address
    for instance in get_worker_instances(ec2_conn, stack_name):
        print "Worker", instance.ip_address
コード例 #2
0
ファイル: director.py プロジェクト: ryan-williams/eggo
def teardown(region, stack_name):
    # terminate Hadoop cluster (prompts for confirmation)
    ec2_conn = create_ec2_connection(region)
    execute(run_director_terminate, hosts=[get_launcher_instance(ec2_conn, stack_name).ip_address])

    # terminate launcher instance
    terminate_launcher_instance(ec2_conn, stack_name)

    # delete stack
    cf_conn = create_cf_connection(region)
    delete_stack(cf_conn, stack_name)
コード例 #3
0
ファイル: director.py プロジェクト: ryan-williams/eggo
def login(region, stack_name, node):
    print ("Logging into the {0} node...".format(node))
    ec2_conn = create_ec2_connection(region)
    if node == "master":
        hosts = [get_master_instance(ec2_conn, stack_name).ip_address]
    elif node == "manager":
        hosts = [get_manager_instance(ec2_conn, stack_name).ip_address]
    elif node == "launcher":
        hosts = [get_launcher_instance(ec2_conn, stack_name).ip_address]
    else:
        raise EggoError('"{0}" is not a valid node type'.format(node))
    execute(open_shell, hosts=hosts)
コード例 #4
0
ファイル: director.py プロジェクト: ryan-williams/eggo
def terminate_launcher_instance(ec2_conn, stack_name):
    launcher_instance = get_launcher_instance(ec2_conn, stack_name)
    launcher_instance.terminate()
    wait_for_instance_state(ec2_conn, launcher_instance, "terminated")