Package org.apache.whirr.service

Examples of org.apache.whirr.service.ClusterSpec$InstanceTemplate


    return ROLE;
  }
 
  @Override
  protected void beforeBootstrap(ClusterActionEvent event) throws IOException {
    ClusterSpec clusterSpec = event.getClusterSpec();
    addRunUrl(event, "util/configure-hostnames", "-c", clusterSpec.getProvider());
    String hadoopInstallRunUrl = clusterSpec.getConfiguration().getString(
        "whirr.hadoop-install-runurl", "apache/hadoop/install");
    addRunUrl(event, "sun/java/install");
    addRunUrl(event, hadoopInstallRunUrl, "-c", clusterSpec.getProvider());
    event.setTemplateBuilderStrategy(new HadoopTemplateBuilderStrategy());
  }
View Full Code Here


    event.setTemplateBuilderStrategy(new HadoopTemplateBuilderStrategy());
  }
 
  @Override
  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 namenodePublicAddress = instance.getPublicAddress();
    InetAddress jobtrackerPublicAddress = namenodePublicAddress;
   
    ComputeServiceContext computeServiceContext =
      ComputeServiceContextBuilder.build(clusterSpec);
    FirewallSettings.authorizeIngress(computeServiceContext, instance, clusterSpec,
        WEB_PORT);
    FirewallSettings.authorizeIngress(computeServiceContext, instance, clusterSpec,
        NAMENODE_WEB_UI_PORT);
    FirewallSettings.authorizeIngress(computeServiceContext, instance, clusterSpec,
        JOBTRACKER_WEB_UI_PORT);
    FirewallSettings.authorizeIngress(computeServiceContext, instance, clusterSpec,
        namenodePublicAddress.getHostAddress(), NAMENODE_PORT);
    FirewallSettings.authorizeIngress(computeServiceContext, instance, clusterSpec,
        namenodePublicAddress.getHostAddress(), JOBTRACKER_PORT);
    if (!namenodePublicAddress.equals(jobtrackerPublicAddress)) {
      FirewallSettings.authorizeIngress(computeServiceContext, instance, clusterSpec,
          jobtrackerPublicAddress.getHostAddress(), NAMENODE_PORT);
      FirewallSettings.authorizeIngress(computeServiceContext, instance, clusterSpec,
          jobtrackerPublicAddress.getHostAddress(), JOBTRACKER_PORT);
    }
   
    String hadoopConfigureRunUrl = clusterSpec.getConfiguration().getString(
        "whirr.hadoop-configure-runurl", "apache/hadoop/post-configure");
    addRunUrl(event, hadoopConfigureRunUrl,
        "nn,jt",
        "-n", DnsUtil.resolveAddress(namenodePublicAddress.getHostAddress()),
        "-j", DnsUtil.resolveAddress(jobtrackerPublicAddress.getHostAddress()),
        "-c", clusterSpec.getProvider());
  }
View Full Code Here

        "-c", clusterSpec.getProvider());
  }
 
  @Override
  protected void afterConfigure(ClusterActionEvent event) throws IOException {
    ClusterSpec clusterSpec = event.getClusterSpec();
    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("Web UI available at http://{}",
View Full Code Here

    assertThat(rc, is(0));

    Configuration conf = new PropertiesConfiguration();
    conf.addProperty("whirr.version", "version-string");

    ClusterSpec expectedClusterSpec = ClusterSpec.withNoDefaults(conf);
    expectedClusterSpec.setInstanceTemplates(Lists.newArrayList(
        new ClusterSpec.InstanceTemplate(1, Sets.newHashSet("role1", "role2")),
        new ClusterSpec.InstanceTemplate(2, Sets.newHashSet("role3"))
    ));
    expectedClusterSpec.setServiceName("test-service");
    expectedClusterSpec.setProvider("rackspace");
    expectedClusterSpec.setIdentity("myusername");
    expectedClusterSpec.setCredential("mypassword");
    expectedClusterSpec.setClusterName("test-cluster");
    expectedClusterSpec.setPrivateKey(keys.get("private"));
    expectedClusterSpec.setPublicKey(keys.get("public"));
   
    verify(factory).create("test-service");
   
    verify(service).launchCluster(expectedClusterSpec);
   
View Full Code Here

    return ROLE;
  }

  @Override
  protected void beforeBootstrap(ClusterActionEvent event) throws IOException {
    ClusterSpec clusterSpec = event.getClusterSpec();
    addRunUrl(event, "util/configure-hostnames",
      HBaseConstants.PARAM_PROVIDER, clusterSpec.getProvider());
    addRunUrl(event, "sun/java/install");
    String hbaseInstallRunUrl = clusterSpec.getConfiguration().getString(
      HBaseConstants.KEY_INSTALL_RUNURL, HBaseConstants.SCRIPT_INSTALL);
      addRunUrl(event, hbaseInstallRunUrl,
        HBaseConstants.PARAM_PROVIDER, clusterSpec.getProvider());
    event.setTemplateBuilderStrategy(new HBaseTemplateBuilderStrategy());
  }
View Full Code Here

    event.setTemplateBuilderStrategy(new HBaseTemplateBuilderStrategy());
  }

  @Override
  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();

    ComputeServiceContext computeServiceContext =
      ComputeServiceContextBuilder.build(clusterSpec);
    FirewallSettings.authorizeIngress(computeServiceContext, instance, clusterSpec,
      MASTER_WEB_UI_PORT);
    FirewallSettings.authorizeIngress(computeServiceContext, instance, clusterSpec,
      masterPublicAddress.getHostAddress(), MASTER_PORT);

    String hbaseConfigureRunUrl = clusterSpec.getConfiguration().getString(
      HBaseConstants.KEY_CONFIGURE_RUNURL, HBaseConstants.SCRIPT_POST_CONFIGURE);
    String master = DnsUtil.resolveAddress(masterPublicAddress.getHostAddress());
    String quorum = ZooKeeperCluster.getHosts(cluster);
      addRunUrl(event, hbaseConfigureRunUrl, ROLE,
        HBaseConstants.PARAM_MASTER, master,
        HBaseConstants.PARAM_QUORUM, quorum,
        HBaseConstants.PARAM_PROVIDER, clusterSpec.getProvider());
  }
View Full Code Here

        HBaseConstants.PARAM_PROVIDER, clusterSpec.getProvider());
  }

  @Override
  protected void afterConfigure(ClusterActionEvent event) throws IOException {
    ClusterSpec clusterSpec = event.getClusterSpec();
    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://{}",
      DnsUtil.resolveAddress(masterPublicAddress.getHostAddress()));
View Full Code Here

    return ROLE;
  }

  @Override
  protected void beforeBootstrap(ClusterActionEvent event) throws IOException {
    ClusterSpec clusterSpec = event.getClusterSpec();
    addRunUrl(event, "util/configure-hostnames",
      HBaseConstants.PARAM_PROVIDER, clusterSpec.getProvider());
    addRunUrl(event, "sun/java/install");
    String hbaseInstallRunUrl = clusterSpec.getConfiguration().getString(
      HBaseConstants.KEY_INSTALL_RUNURL, HBaseConstants.SCRIPT_INSTALL);
      addRunUrl(event, hbaseInstallRunUrl,
        HBaseConstants.PARAM_PROVIDER, clusterSpec.getProvider());
    event.setTemplateBuilderStrategy(new HBaseTemplateBuilderStrategy());
  }
View Full Code Here

  }

  @Override
  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();

    ComputeServiceContext computeServiceContext =
      ComputeServiceContextBuilder.build(clusterSpec);
    FirewallSettings.authorizeIngress(computeServiceContext, instance, clusterSpec,
      REGIONSERVER_WEB_UI_PORT);
    FirewallSettings.authorizeIngress(computeServiceContext, instance, clusterSpec,
      masterPublicAddress.getHostAddress(), REGIONSERVER_PORT);

    String hbaseConfigureRunUrl = clusterSpec.getConfiguration().getString(
      HBaseConstants.KEY_CONFIGURE_RUNURL,
      HBaseConstants.SCRIPT_POST_CONFIGURE);
    String master = DnsUtil.resolveAddress(masterPublicAddress.getHostAddress());
    String quorum = ZooKeeperCluster.getHosts(cluster);
      addRunUrl(event, hbaseConfigureRunUrl, ROLE,
        HBaseConstants.PARAM_MASTER, master,
        HBaseConstants.PARAM_QUORUM, quorum,
        HBaseConstants.PARAM_PROVIDER, clusterSpec.getProvider());
  }
View Full Code Here

    return role;
  }

  @Override
  protected void beforeBootstrap(ClusterActionEvent event) throws IOException {
    ClusterSpec clusterSpec = event.getClusterSpec();
    addRunUrl(event, "util/configure-hostnames",
      HBaseConstants.PARAM_PROVIDER, clusterSpec.getProvider());
    addRunUrl(event, "sun/java/install");
    String hbaseInstallRunUrl = clusterSpec.getConfiguration().getString(
      HBaseConstants.KEY_INSTALL_RUNURL, HBaseConstants.SCRIPT_INSTALL);
      addRunUrl(event, hbaseInstallRunUrl,
        HBaseConstants.PARAM_PROVIDER, clusterSpec.getProvider());
    event.setTemplateBuilderStrategy(new HBaseTemplateBuilderStrategy());
  }
View Full Code Here

TOP

Related Classes of org.apache.whirr.service.ClusterSpec$InstanceTemplate

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.