use of org.apache.whirr.ClusterSpec in project whirr by apache.
the class GangliaMetadClusterActionHandler 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_METAD_ROLE));
}
use of org.apache.whirr.ClusterSpec in project whirr by apache.
the class ElasticSearchHandler method beforeBootstrap.
@Override
protected void beforeBootstrap(ClusterActionEvent event) throws IOException {
ClusterSpec spec = event.getClusterSpec();
Configuration config = spec.getConfiguration();
addStatement(event, call("retry_helpers"));
addStatement(event, call("install_tarball"));
addStatement(event, call(getInstallFunction(config, "java", "install_openjdk")));
String tarurl = prepareRemoteFileUrl(event, config.getString("whirr.elasticsearch.tarball.url", ""));
addStatement(event, call("install_elasticsearch", tarurl));
}
use of org.apache.whirr.ClusterSpec in project whirr by apache.
the class ElasticSearchConfigurationBuilderTest method testOverrideDefaults.
@Test
public void testOverrideDefaults() throws Exception {
Configuration baseConfig = new PropertiesConfiguration();
baseConfig.addProperty("whirr.provider", "aws-ec2");
baseConfig.addProperty("es.index.store.type", "fs");
ClusterSpec spec = ClusterSpec.withTemporaryKeys(baseConfig);
Configuration config = ElasticSearchConfigurationBuilder.buildConfig(spec, null);
assertThat(config.getString("es.index.store.type"), is("fs"));
}
use of org.apache.whirr.ClusterSpec in project whirr by apache.
the class ElasticSearchConfigurationBuilderTest method testDefaultUnicastConfig.
@Test
public void testDefaultUnicastConfig() throws Exception {
Configuration baseConfig = new PropertiesConfiguration();
baseConfig.addProperty("whirr.provider", "cloudservers-us");
ClusterSpec spec = ClusterSpec.withTemporaryKeys(baseConfig);
Cluster cluster = mock(Cluster.class);
Set<Cluster.Instance> instances = Sets.newLinkedHashSet();
for (String host : Lists.newArrayList("10.0.0.1", "10.0.0.2")) {
Cluster.Instance instance = mock(Cluster.Instance.class);
when(instance.getPrivateIp()).thenReturn(host);
instances.add(instance);
}
when(cluster.getInstancesMatching((Predicate<Cluster.Instance>) any())).thenReturn(instances);
Configuration config = ElasticSearchConfigurationBuilder.buildConfig(spec, cluster);
String content = StringUtils.join(ElasticSearchConfigurationBuilder.asYamlLines(config.subset(ElasticSearchConfigurationBuilder.ES_PREFIX)), "\n");
assertThat(content, is("index:\n" + " store:\n" + " type: memory\n" + "gateway:\n" + " type: none\n" + "discovery:\n" + " zen:\n" + " ping:\n" + " multicast:\n" + " enabled: false\n" + " unicast:\n" + " hosts: [\"10.0.0.1:9300\", \"10.0.0.2:9300\"]"));
}
use of org.apache.whirr.ClusterSpec in project whirr by apache.
the class HamaClusterActionHandler method beforeBootstrap.
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 hamaInstallFunction = conf.getString(HamaConstants.KEY_INSTALL_FUNCTION, HamaConstants.FUNCTION_INSTALL);
String tarurl = prepareRemoteFileUrl(event, conf.getString(HamaConstants.KEY_TARBALL_URL));
addStatement(event, call(hamaInstallFunction, HamaConstants.PARAM_TARBALL_URL, tarurl));
}
Aggregations