Package org.apache.whirr.Cluster

Examples of org.apache.whirr.Cluster.Instance


    Cluster cluster = event.getCluster();
   
    // TODO: wait for TTs to come up (done in test for the moment)
   
    LOG.info("Completed configuration of {}", clusterSpec.getClusterName());
    Instance instance = cluster.getInstanceMatching(role(ROLE));
    InetAddress namenodePublicAddress = instance.getPublicAddress();
    InetAddress jobtrackerPublicAddress = namenodePublicAddress;

    LOG.info("Namenode web UI available at http://{}:{}",
      namenodePublicAddress.getHostName(), NAMENODE_WEB_UI_PORT);
    LOG.info("Jobtracker web UI available at http://{}:{}",
View Full Code Here


  static Configuration buildCommonConfiguration(ClusterSpec clusterSpec,
      Cluster cluster, Configuration defaults) throws ConfigurationException, IOException {
    Configuration config = build(clusterSpec, cluster, defaults,
        "hadoop-common");

    Instance namenode = cluster
        .getInstanceMatching(role(HadoopNameNodeClusterActionHandler.ROLE));
    config.setProperty("fs.default.name", String.format("hdfs://%s:8020/",
        namenode.getPublicAddress().getHostName()));
    return config;
  }
View Full Code Here

        setIfAbsent(config, "mapred.reduce.tasks", clusterReduceSlots + "");

      }
    }

    Instance jobtracker = cluster
        .getInstanceMatching(role(HadoopJobTrackerClusterActionHandler.ROLE));
    config.setProperty("mapred.job.tracker", String.format("%s:8021",
        jobtracker.getPublicAddress().getHostName()));
    return config;
  }
View Full Code Here

  protected void beforeConfigure(ClusterActionEvent event)
      throws IOException, InterruptedException {
    ClusterSpec clusterSpec = event.getClusterSpec();
    Cluster cluster = event.getCluster();

    Instance instance = cluster.getInstanceMatching(
      role(HBaseMasterClusterActionHandler.ROLE));
    InetAddress masterPublicAddress = instance.getPublicAddress();

    event.getFirewallManager().addRules(
      Rule.create()
        .destination(instance)
        .ports(REGIONSERVER_WEB_UI_PORT, REGIONSERVER_PORT)
View Full Code Here

        ImmutableMap.<String,String>of(), ImmutableSet.<String>of(), processors,
        1024, ImmutableList.<Volume>of(), null);
    when(node.getHardware()).thenReturn(hardware);
   
    Builder<Instance> instances = ImmutableSet.<Instance>builder();
    Instance master = new Instance(new Credentials("", ""),
        ImmutableSet.of(HadoopNameNodeClusterActionHandler.ROLE,
            HadoopJobTrackerClusterActionHandler.ROLE),
            "10.0.0.1", "10.0.0.1", "1", node);
    instances.add(master);
    for (int i = 0; i < numberOfWorkers; i++) {
      int id = i + 2;
      instances.add(new Instance(new Credentials("", ""),
        ImmutableSet.of(HadoopDataNodeClusterActionHandler.ROLE,
              HadoopTaskTrackerClusterActionHandler.ROLE),
              "10.0.0." + id, "10.0.0." + id, id + "", node));
    }
    return new Cluster(instances.build());
View Full Code Here

  protected void beforeConfigure(ClusterActionEvent event) throws IOException, InterruptedException {
    ClusterSpec clusterSpec = event.getClusterSpec();
    Cluster cluster = event.getCluster();

    LOG.info("Authorizing firewall");
    Instance instance = cluster.getInstanceMatching(role(ROLE));
    InetAddress masterPublicAddress = instance.getPublicAddress();

    event.getFirewallManager().addRules(
      Rule.create()
        .destination(instance)
        .ports(MASTER_WEB_UI_PORT, MASTER_PORT)
View Full Code Here

    Cluster cluster = event.getCluster();

    // TODO: wait for regionservers to come up?

    LOG.info("Completed configuration of {}", clusterSpec.getClusterName());
    Instance instance = cluster.getInstanceMatching(role(ROLE));
    InetAddress masterPublicAddress = instance.getPublicAddress();

    LOG.info("Web UI available at http://{}", masterPublicAddress.getHostName());
    String quorum = ZooKeeperCluster.getHosts(cluster);
    Properties config = createClientSideProperties(masterPublicAddress, quorum);
    createClientSideHadoopSiteFile(clusterSpec, config);
View Full Code Here

    ClusterSpec clusterSpec = event.getClusterSpec();
    Cluster cluster = event.getCluster();
    Configuration conf = getConfiguration(clusterSpec);

    LOG.info("Authorizing firewall");
    Instance instance = cluster.getInstanceMatching(role(ROLE));
    InetAddress masterPublicAddress = instance.getPublicAddress();

    event.getFirewallManager().addRules(
      Rule.create()
        .destination(instance)
        .ports(MASTER_WEB_UI_PORT, MASTER_PORT)
View Full Code Here

    Cluster cluster = event.getCluster();

    // TODO: wait for regionservers to come up?

    LOG.info("Completed configuration of {}", clusterSpec.getClusterName());
    Instance instance = cluster.getInstanceMatching(role(ROLE));
    InetAddress masterPublicAddress = instance.getPublicAddress();

    LOG.info("Web UI available at http://{}", masterPublicAddress.getHostName());
    String quorum = ZooKeeperCluster.getHosts(cluster);
    Properties config = createClientSideProperties(masterPublicAddress, quorum);
    createClientSideHadoopSiteFile(clusterSpec, config);
View Full Code Here

  protected void beforeConfigure(ClusterActionEvent event) throws IOException,
      InterruptedException {
    ClusterSpec clusterSpec = event.getClusterSpec();
    Cluster cluster = event.getCluster();

    Instance instance = cluster
        .getInstanceMatching(role(HamaMasterClusterActionHandler.ROLE));
    InetAddress masterPublicAddress = instance.getPublicAddress();

    event.getFirewallManager().addRules(
        Rule.create().destination(instance).ports(61000, GROOMSERVER_PORT));

    String hamaConfigureFunction = getConfiguration(clusterSpec).getString(
View Full Code Here

TOP

Related Classes of org.apache.whirr.Cluster.Instance

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.