Package org.apache.whirr

Examples of org.apache.whirr.ClusterSpec


    addStatement(event, call(configureFunction, "-m", metadHost));
  }
 
  @Override
  protected void afterConfigure(ClusterActionEvent event) {
    ClusterSpec clusterSpec = event.getClusterSpec();
    Cluster cluster = event.getCluster();

    LOG.info("Completed configuration of {}", clusterSpec.getClusterName());
    String hosts = Joiner.on(',').join(getHosts(cluster.getInstancesMatching(
      role(GANGLIA_MONITOR_ROLE))));
    LOG.info("Monitors: {}", hosts);
  }
View Full Code Here


                             servers));
  }

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

    String servers = Joiner.on(' ').join(getPrivateIps(cluster.getInstances()));

    LOG.info("Completed setup of Voldemort {} with servers {}",
        clusterSpec.getClusterName(), servers);
  }
View Full Code Here

    return getConfigureFunction(config, getRole(), GangliaCluster.CONFIGURE_FUNCTION);
  }

  @Override
  protected void beforeBootstrap(ClusterActionEvent event) throws IOException {
    ClusterSpec clusterSpec = event.getClusterSpec();
    Configuration config = getConfiguration(clusterSpec);

    addStatement(event, call("retry_helpers"));
    addStatement(event, call(getInstallFunction(config),
      "-r", GANGLIA_METAD_ROLE)
View Full Code Here

    );
  }

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

    // FIXME: the ganglia port is only opened so the ganglia xml dump can be checked in GangliaServiceTest
    event.getFirewallManager().addRule(
        Rule.create().destination(role(GANGLIA_METAD_ROLE)).ports(HTTP_PORT, GANGLIA_META_PORT)
View Full Code Here

    addStatement(event, call(configureFunction, "-m", metadHost));
  }
 
  @Override
  protected void afterConfigure(ClusterActionEvent event) {
    ClusterSpec clusterSpec = event.getClusterSpec();
    Cluster cluster = event.getCluster();

    LOG.info("Completed configuration of {}", clusterSpec.getClusterName());
    String hosts = Joiner.on(',').join(getHosts(cluster.getInstancesMatching(
      role(GANGLIA_METAD_ROLE))));
    LOG.info("Meta host: {}. You should be able to connect on http://{}/ganglia", hosts, hosts);
  }
View Full Code Here

   * Tests that a simple recipe (the default recipe in a cookbook without any
   * configuration parameters) is correctly loaded and executed.
   */
  @Test
  public void testChefOnly() throws Exception {
    ClusterSpec chefOnly = newClusterSpecForProperties(ImmutableMap.of("whirr.instance-templates", "1 chef"));
    DryRun dryRun = launchWithClusterSpec(chefOnly);
    assertScriptPredicateOnPhase(dryRun, "bootstrap", bootstrapPredicate());
    // We now have iptables calls by default in the configure phase.
  }
View Full Code Here

   * Tests that a simple recipe (the default recipe in a cookbook without any
   * configuration parameters) is correctly loaded and executed.
   */
  @Test
  public void testChefWithDefaultRecipe() throws Exception {
    ClusterSpec cookbookWithDefaultRecipe = newClusterSpecForProperties(ImmutableMap.of("whirr.instance-templates",
        "1 chef:java"));
    DryRun dryRun = launchWithClusterSpec(cookbookWithDefaultRecipe);

    assertScriptPredicateOnPhase(dryRun, "bootstrap", bootstrapPredicate());

View Full Code Here

   * Tests that a simple recipe (the default recipe in a cookbook without any
   * configuration parameters) is correctly loaded and executed.
   */
  @Test
  public void testChefWithAttributes() throws Exception {
    ClusterSpec cookbookWithSpecificRecipe = newClusterSpecForProperties(ImmutableMap.of("whirr.instance-templates",
        "1 chef:java:sun"));
    DryRun dryRun = launchWithClusterSpec(cookbookWithSpecificRecipe);

    assertScriptPredicateOnPhase(dryRun, "bootstrap", bootstrapPredicate());

View Full Code Here

   * Tests that a simple recipe (the default recipe in a cookbook without any
   * configuration parameters) is correctly loaded and executed.
   */
  @Test
  public void testChefWithParticularRecipe() throws Exception {
    ClusterSpec cookbookWithAttributes = newClusterSpecForProperties(ImmutableMap.<String, String> builder()
        .put("whirr.instance-templates", "1 chef:java").put("java.url", "http://testurl")
        .put("java.version", "1.5").put("java.flavor", "vanilla").build());
    DryRun dryRun = launchWithClusterSpec(cookbookWithAttributes);

    assertScriptPredicateOnPhase(dryRun, "bootstrap", bootstrapPredicate());
View Full Code Here

  }
 
  @Override
  protected void beforeConfigure(ClusterActionEvent event) throws IOException,
      InterruptedException {
    ClusterSpec clusterSpec = event.getClusterSpec();
    Configuration conf = getConfiguration(clusterSpec);
    Cluster cluster = event.getCluster();
   
    Instance resourceManager = cluster.getInstanceMatching(role(ROLE));
    event.getFirewallManager().addRules(
View Full Code Here

TOP

Related Classes of org.apache.whirr.ClusterSpec

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.