Package org.apache.whirr.Cluster

Examples of org.apache.whirr.Cluster.Instance


 
  @Override
  protected void afterConfigure(ClusterActionEvent event) throws IOException {
    ClusterSpec clusterSpec = event.getClusterSpec();
    Cluster cluster = event.getCluster();
    Instance resourceManager = cluster.getInstanceMatching(role(ROLE));
    LOG.info("Resource manager web UI available at http://{}:{}",
      resourceManager.getPublicHostName(), RESOURCE_MANAGER_WEB_UI_PORT);
   
    Properties mrConfig = createClientSideMapReduceProperties(clusterSpec);
    createClientSideMapReduceSiteFile(clusterSpec, mrConfig);

    Properties yarnConfig = createClientSideYarnProperties(clusterSpec, resourceManager);
View Full Code Here


        "-u", tarball));
  }
 
  protected Map<String, String> getDeviceMappings(ClusterActionEvent event) {
      Set<Instance> instances = event.getCluster().getInstancesMatching(RolePredicates.role(getRole()));
      Instance prototype = Iterables.getFirst(instances, null);
      if (prototype == null) {
          throw new IllegalStateException("No instances found in role " + getRole());
      }
      VolumeManager volumeManager = new VolumeManager();
      return volumeManager.getDeviceMappings(event.getClusterSpec(), prototype);
View Full Code Here

        ImmutableMap.<String,String>of(), ImmutableSet.<String>of(), processors,
        1024, ImmutableList.<Volume>of(), null, "xen");
    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, fakeDnsResolver);
    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, fakeDnsResolver));
    }
    return new Cluster(instances.build());
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));
    LOG.debug("hadoop building common configuration, with hostname "+namenode.getPublicHostName());
    config.setProperty("fs.default.name", String.format("hdfs://%s:8020/",
        namenode.getPublicHostName()));
    return config;
  }
View Full Code Here

  public static final String EXPECTED_SSH_COMMAND = "\nYou can log into instances using the following ssh commands:\n"
      + "'ssh -i /test/key/path -o \"UserKnownHostsFile /dev/null\" -o StrictHostKeyChecking=no test-identity@test-public-ip'\n";

  @Test
  public void testPrintAccess() {
    final Instance instance = mock(Instance.class);

    when(instance.getPublicIp()).thenReturn("test-public-ip");

    Cluster cluster = mock(Cluster.class);

    when(cluster.getInstances()).thenReturn(ImmutableSet.<Cluster.Instance>of(instance));
View Full Code Here

    if (role.equals(YarnResourceManagerHandler.ROLE)) {
      config.setProperty("yarn.resourcemanager.address", "0.0.0.0:8040");
      config.setProperty("yarn.resourcemanager.scheduler.address", "0.0.0.0:8030");
      config.setProperty("yarn.resourcemanager.resource-tracker.address", "0.0.0.0:8025");
    } else {
      Instance resourceManager = cluster
          .getInstanceMatching(role(YarnResourceManagerHandler.ROLE));
      String resourceManagerPrivateAddress =
        resourceManager.getPrivateAddress().getHostName();
      config.setProperty("yarn.resourcemanager.address",
          String.format("%s:8040", resourceManagerPrivateAddress));
      config.setProperty("yarn.resourcemanager.scheduler.address",
          String.format("%s:8030", resourceManagerPrivateAddress));
      config.setProperty("yarn.resourcemanager.resource-tracker.address",
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(GROOMSERVER_PORT));

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

      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),
        Rule.create().destination(instance).ports(MASTER_PORT));
View Full Code Here

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

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

    LOG.info("BSPMaster web UI available at http://{}:{}", masterPublicAddress
        .getHostName(), MASTER_WEB_UI_PORT);

    String quorum = ZooKeeperCluster.getHosts(cluster);
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

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.