Search in sources :

Example 91 with ClusterSpec

use of org.apache.whirr.ClusterSpec in project whirr by apache.

the class GangliaMonitorClusterActionHandler method beforeBootstrap.

@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_MONITOR_ROLE));
}
Also used : Configuration(org.apache.commons.configuration.Configuration) ClusterSpec(org.apache.whirr.ClusterSpec)

Example 92 with ClusterSpec

use of org.apache.whirr.ClusterSpec in project whirr by apache.

the class GangliaMonitorClusterActionHandler method beforeConfigure.

@Override
protected void beforeConfigure(ClusterActionEvent event) throws IOException, InterruptedException {
    ClusterSpec clusterSpec = event.getClusterSpec();
    Cluster cluster = event.getCluster();
    event.getFirewallManager().addRule(Rule.create().destination(role(GANGLIA_MONITOR_ROLE)).port(GANGLIA_MONITOR_PORT));
    handleFirewallRules(event);
    Configuration config = getConfiguration(clusterSpec);
    String configureFunction = getConfigureFunction(config);
    // Call the configure function.
    String metadHost = cluster.getInstanceMatching(role(GANGLIA_METAD_ROLE)).getPrivateIp();
    addStatement(event, call("retry_helpers"));
    addStatement(event, call(configureFunction, "-m", metadHost));
}
Also used : Configuration(org.apache.commons.configuration.Configuration) Cluster(org.apache.whirr.Cluster) ClusterSpec(org.apache.whirr.ClusterSpec)

Example 93 with ClusterSpec

use of org.apache.whirr.ClusterSpec in project whirr by apache.

the class GangliaMonitorClusterActionHandler method afterConfigure.

@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);
}
Also used : Cluster(org.apache.whirr.Cluster) ClusterSpec(org.apache.whirr.ClusterSpec)

Example 94 with ClusterSpec

use of org.apache.whirr.ClusterSpec in project whirr by apache.

the class HadoopClusterActionHandler method beforeBootstrap.

@Override
protected void beforeBootstrap(ClusterActionEvent event) throws IOException {
    ClusterSpec clusterSpec = event.getClusterSpec();
    Configuration conf = getConfiguration(clusterSpec);
    addStatement(event, call("retry_helpers"));
    addStatement(event, call("configure_hostnames"));
    addStatement(event, call("install_tarball"));
    addStatement(event, call(getInstallFunction(conf, "java", "install_openjdk")));
    String tarball = prepareRemoteFileUrl(event, conf.getString("whirr.hadoop.tarball.url"));
    addStatement(event, call(getInstallFunction(conf), "-u", tarball));
}
Also used : Configuration(org.apache.commons.configuration.Configuration) ClusterSpec(org.apache.whirr.ClusterSpec)

Example 95 with ClusterSpec

use of org.apache.whirr.ClusterSpec in project whirr by apache.

the class HadoopClusterActionHandler method beforeConfigure.

@Override
protected void beforeConfigure(ClusterActionEvent event) throws IOException, InterruptedException {
    ClusterSpec clusterSpec = event.getClusterSpec();
    Cluster cluster = event.getCluster();
    doBeforeConfigure(event);
    handleFirewallRules(event);
    createHadoopConfigFiles(event, clusterSpec, cluster);
    addStatement(event, call("retry_helpers"));
    addStatement(event, call(getConfigureFunction(getConfiguration(clusterSpec)), Joiner.on(",").join(event.getInstanceTemplate().getRoles()), "-c", clusterSpec.getProvider()));
}
Also used : Cluster(org.apache.whirr.Cluster) ClusterSpec(org.apache.whirr.ClusterSpec)

Aggregations

ClusterSpec (org.apache.whirr.ClusterSpec)98 Configuration (org.apache.commons.configuration.Configuration)39 Cluster (org.apache.whirr.Cluster)35 Test (org.junit.Test)34 PropertiesConfiguration (org.apache.commons.configuration.PropertiesConfiguration)16 Instance (org.apache.whirr.Cluster.Instance)14 ClusterController (org.apache.whirr.ClusterController)10 InetAddress (java.net.InetAddress)9 DryRun (org.apache.whirr.service.DryRunModule.DryRun)9 OptionSet (joptsimple.OptionSet)8 CompositeConfiguration (org.apache.commons.configuration.CompositeConfiguration)8 ZooKeeperCluster (org.apache.whirr.service.zookeeper.ZooKeeperCluster)8 IOException (java.io.IOException)7 ComputeService (org.jclouds.compute.ComputeService)7 File (java.io.File)6 ClusterControllerFactory (org.apache.whirr.ClusterControllerFactory)6 ComputeServiceContext (org.jclouds.compute.ComputeServiceContext)6 Set (java.util.Set)5 Stack (java.util.Stack)5 Matchers.containsString (org.hamcrest.Matchers.containsString)5