Search in sources :

Example 86 with ClusterSpec

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

the class HadoopTaskTrackerClusterActionHandler method afterConfigure.

@Override
protected void afterConfigure(ClusterActionEvent event) throws IOException, InterruptedException {
    ClusterSpec clusterSpec = event.getClusterSpec();
    // TODO: wait for TTs to come up (done in test for the moment)
    LOG.info("Completed configuration of {} role {}", clusterSpec.getClusterName(), getRole());
// TODO: List task trackers + url to their WEB UI?
}
Also used : ClusterSpec(org.apache.whirr.ClusterSpec)

Example 87 with ClusterSpec

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

the class DruidMySQLClusterActionHandler method beforeBootstrap.

@Override
protected void beforeBootstrap(ClusterActionEvent event) throws IOException {
    ClusterSpec clusterSpec = event.getClusterSpec();
    Configuration conf = getConfiguration(clusterSpec);
    addStatement(event, call("configure_hostnames"));
    // installed/run via apt-get
    addStatement(event, call("install_mysql"));
}
Also used : Configuration(org.apache.commons.configuration.Configuration) ClusterSpec(org.apache.whirr.ClusterSpec)

Example 88 with ClusterSpec

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

the class ElasticSearchHandler method beforeConfigure.

@Override
protected void beforeConfigure(ClusterActionEvent event) throws IOException {
    ClusterSpec spec = event.getClusterSpec();
    Cluster cluster = event.getCluster();
    event.getFirewallManager().addRule(Rule.create().destination(cluster.getInstancesMatching(role(ROLE))).port(HTTP_CLIENT_PORT));
    handleFirewallRules(event);
    Configuration config = ElasticSearchConfigurationBuilder.buildConfig(spec, cluster);
    addStatement(event, call("retry_helpers"));
    addStatement(event, ElasticSearchConfigurationBuilder.build("/tmp/elasticsearch.yml", config));
    addStatement(event, call("configure_elasticsearch", config.getStringArray("es.plugins")));
}
Also used : Configuration(org.apache.commons.configuration.Configuration) Cluster(org.apache.whirr.Cluster) ClusterSpec(org.apache.whirr.ClusterSpec)

Example 89 with ClusterSpec

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

the class ElasticSearchConfigurationBuilderTest method testDefaultConfigAwsEC2.

@Test
public void testDefaultConfigAwsEC2() throws Exception {
    Configuration baseConfig = new PropertiesConfiguration();
    baseConfig.addProperty("whirr.provider", "aws-ec2");
    baseConfig.addProperty("es.plugins", "lang-javascript, lang-python");
    ClusterSpec spec = ClusterSpec.withTemporaryKeys(baseConfig);
    Configuration config = ElasticSearchConfigurationBuilder.buildConfig(spec, null);
    assertThat(config.getStringArray("es.plugins"), is(new String[] { "lang-javascript", "lang-python", "elasticsearch/elasticsearch-cloud-aws/1.5.0" }));
    assertThat(config.getString("es.discovery.type"), is("ec2"));
}
Also used : Configuration(org.apache.commons.configuration.Configuration) PropertiesConfiguration(org.apache.commons.configuration.PropertiesConfiguration) ClusterSpec(org.apache.whirr.ClusterSpec) PropertiesConfiguration(org.apache.commons.configuration.PropertiesConfiguration) Test(org.junit.Test)

Example 90 with ClusterSpec

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

the class GangliaMetadClusterActionHandler method beforeConfigure.

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

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