Exemple #1
0
def _number_of_tasktrackers(jt_hostname, timeout, retries=0):
    jt_page = url_get("http://%s:50030/jobtracker.jsp" % jt_hostname, timeout,
                      retries)
    m = NUMBER_OF_TASK_TRACKERS.search(jt_page)
    if m:
        return int(m.group(1))
    return 0
def _authorize_client_ports(cluster, master, client_cidrs):
  if not client_cidrs:
    logger.debug("No client CIDRs specified, using local address.")
    client_ip = url_get('http://checkip.amazonaws.com/').strip()
    client_cidrs = ("%s/32" % client_ip,)
  logger.debug("Client CIDRs: %s", client_cidrs)
  for client_cidr in client_cidrs:
    # Allow access to port 80 on master from client
    cluster.authorize_role(MASTER, 80, 80, client_cidr)
    # Allow access to jobtracker UI on master from client (so we can see when the cluster is ready)
    cluster.authorize_role(MASTER, 50030, 50030, client_cidr)
    # Allow access to namenode and jobtracker via public address from master node
  master_ip = socket.gethostbyname(master.public_dns_name)
Exemple #3
0
def _authorize_client_ports(cluster, master, client_cidrs):
    if not client_cidrs:
        logger.debug("No client CIDRs specified, using local address.")
        client_ip = url_get('http://checkip.amazonaws.com/').strip()
        client_cidrs = ("%s/32" % client_ip, )
    logger.debug("Client CIDRs: %s", client_cidrs)
    for client_cidr in client_cidrs:
        # Allow access to port 80 on master from client
        cluster.authorize_role(MASTER, 80, 80, client_cidr)
        # Allow access to jobtracker UI on master from client (so we can see when the cluster is ready)
        cluster.authorize_role(MASTER, 50030, 50030, client_cidr)
        # Allow access to namenode and jobtracker via public address from master node
    master_ip = socket.gethostbyname(master.public_dns_name)
    cluster.authorize_role(MASTER, 8020, 8021, "%s/32" % master_ip)
def _number_of_tasktrackers(jt_hostname, timeout, retries=0):
  jt_page = url_get("http://%s:50030/jobtracker.jsp" % jt_hostname, timeout, retries)
  m = NUMBER_OF_TASK_TRACKERS.search(jt_page)
  if m:
    return int(m.group(1))
  return 0