Search in sources :

Example 46 with ClusterSpec

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));
}
Also used : Configuration(org.apache.commons.configuration.Configuration) ClusterSpec(org.apache.whirr.ClusterSpec)

Example 47 with ClusterSpec

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"));
}
Also used : Configuration(org.apache.commons.configuration.Configuration) AbstractConfiguration(org.apache.commons.configuration.AbstractConfiguration) Instance(org.apache.whirr.Cluster.Instance) ConfigurationException(org.apache.commons.configuration.ConfigurationException) Cluster(org.apache.whirr.Cluster) ClusterSpec(org.apache.whirr.ClusterSpec) IOException(java.io.IOException)

Example 48 with ClusterSpec

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)));
}
Also used : Configuration(org.apache.commons.configuration.Configuration) ClusterSpec(org.apache.whirr.ClusterSpec)

Example 49 with ClusterSpec

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));
}
Also used : Configuration(org.apache.commons.configuration.Configuration) Instance(org.apache.whirr.Cluster.Instance) Cluster(org.apache.whirr.Cluster) ClusterSpec(org.apache.whirr.ClusterSpec)

Example 50 with ClusterSpec

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);
}
Also used : 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