use of org.apache.whirr.ClusterSpec in project whirr by apache.
the class YarnHandler 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(getInstallFunction(conf, "java", "install_openjdk")));
addStatement(event, call("install_tarball"));
String installFn = getInstallFunction(conf);
String tarball = prepareRemoteFileUrl(event, conf.getString("whirr.hadoop.tarball.url"));
addStatement(event, call(installFn, "-u", tarball));
}
use of org.apache.whirr.ClusterSpec in project whirr by apache.
the class YarnResourceManagerHandler method beforeConfigure.
@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(Rule.create().destination(resourceManager).ports(RESOURCE_MANAGER_RPC_PORT, RESOURCE_MANAGER_WEB_UI_PORT), Rule.create().source(resourceManager.getPublicIp()).destination(resourceManager).ports(RESOURCE_MANAGER_RPC_PORT));
handleFirewallRules(event);
try {
event.getStatementBuilder().addStatements(build("/tmp/yarn-site.xml", clusterSpec, cluster, ROLE));
} catch (ConfigurationException e) {
throw new IOException(e);
}
addStatement(event, call(getConfigureFunction(conf)));
addStatement(event, call(getStartFunction(conf), "resourcemanager"));
}
use of org.apache.whirr.ClusterSpec in project whirr by apache.
the class ZooKeeperClusterActionHandler 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("install_tarball"));
addStatement(event, call("install_service"));
addStatement(event, call(getInstallFunction(config, "java", "install_openjdk")));
String tarurl = config.getString("whirr.zookeeper.tarball.url");
addStatement(event, call(getInstallFunction(config), "-u", prepareRemoteFileUrl(event, tarurl)));
}
use of org.apache.whirr.ClusterSpec in project whirr by apache.
the class ZooKeeperClusterActionHandler 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(ZOOKEEPER_ROLE)).port(CLIENT_PORT));
handleFirewallRules(event);
// Pass list of all servers in ensemble to configure script.
// Position is significant: i-th server has id i.
Set<Instance> ensemble = cluster.getInstancesMatching(role(ZOOKEEPER_ROLE));
String servers = Joiner.on(' ').join(getPrivateIps(ensemble));
Configuration config = getConfiguration(clusterSpec);
addStatement(event, call("retry_helpers"));
addStatement(event, call(getConfigureFunction(config), servers));
}
use of org.apache.whirr.ClusterSpec in project whirr by apache.
the class VoldemortClusterActionHandler method afterConfigure.
@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);
}
Aggregations