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));
}
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));
}
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);
}
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));
}
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()));
}
Aggregations