use of org.apache.whirr.ClusterSpec in project whirr by apache.
the class SolrClusterActionHandler method beforeStop.
@Override
protected void beforeStop(ClusterActionEvent event) throws IOException {
ClusterSpec clusterSpec = event.getClusterSpec();
Configuration config = getConfiguration(clusterSpec, SOLR_DEFAULT_CONFIG);
int jettyStopPort = config.getInt(SOLR_JETTY_STOP_PORT);
String stopFunc = getStopFunction(config, getRole(), "stop_" + getRole());
LOG.info("Stopping Solr");
addStatement(event, call(stopFunc, SOLR_HOME, String.valueOf(jettyStopPort), safeSecretString(config.getString(SOLR_JETTY_STOP_SECRET)), SOLR_HOME + "/example/start.jar"));
}
use of org.apache.whirr.ClusterSpec in project whirr by apache.
the class YarnNodeManagerHandler method beforeConfigure.
@Override
protected void beforeConfigure(ClusterActionEvent event) throws IOException, InterruptedException {
ClusterSpec clusterSpec = event.getClusterSpec();
Configuration conf = getConfiguration(clusterSpec);
Cluster cluster = event.getCluster();
Set<Instance> nodeManagers = cluster.getInstancesMatching(role(ROLE));
if (!nodeManagers.isEmpty()) {
for (Instance nodeManager : nodeManagers) {
event.getFirewallManager().addRules(Rule.create().destination(nodeManager).ports(NODE_MANAGER_WEB_UI_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), "nodemanager"));
}
use of org.apache.whirr.ClusterSpec in project whirr by apache.
the class YarnResourceManagerHandler method afterConfigure.
@Override
protected void afterConfigure(ClusterActionEvent event) throws IOException {
ClusterSpec clusterSpec = event.getClusterSpec();
Cluster cluster = event.getCluster();
Instance resourceManager = cluster.getInstanceMatching(role(ROLE));
LOG.info("Resource manager web UI available at http://{}:{}", resourceManager.getPublicHostName(), RESOURCE_MANAGER_WEB_UI_PORT);
Properties mrConfig = createClientSideMapReduceProperties(clusterSpec);
createClientSideMapReduceSiteFile(clusterSpec, mrConfig);
Properties yarnConfig = createClientSideYarnProperties(clusterSpec, resourceManager);
createClientSideYarnSiteFile(clusterSpec, yarnConfig);
Properties combined = new Properties();
combined.putAll(cluster.getConfiguration());
combined.putAll(mrConfig);
combined.putAll(yarnConfig);
event.setCluster(new Cluster(cluster.getInstances(), combined));
}
use of org.apache.whirr.ClusterSpec in project whirr by apache.
the class HBaseMasterClusterActionHandler 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("install_tarball"));
addStatement(event, call("configure_hostnames"));
addStatement(event, call(getInstallFunction(conf, "java", "install_openjdk")));
String tarurl = prepareRemoteFileUrl(event, getConfiguration(clusterSpec).getString(HBaseConstants.KEY_TARBALL_URL));
addStatement(event, call(getInstallFunction(getConfiguration(clusterSpec)), HBaseConstants.PARAM_TARBALL_URL, tarurl));
}
use of org.apache.whirr.ClusterSpec in project whirr by apache.
the class BasicServerClusterActionHandler 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 tarurl = prepareRemoteFileUrl(event, conf.getString(HBaseConstants.KEY_TARBALL_URL));
addStatement(event, call(getInstallFunction(conf), HBaseConstants.PARAM_TARBALL_URL, tarurl));
}
Aggregations