Search in sources :

Example 1 with HadoopProxy

use of org.apache.whirr.service.hadoop.HadoopProxy in project whirr by apache.

the class HamaMasterClusterActionHandler method createProxyScript.

private void createProxyScript(ClusterSpec clusterSpec, Cluster cluster) {
    File configDir = getConfigDir(clusterSpec);
    File hamaProxyFile = new File(configDir, "hama-proxy.sh");
    try {
        HadoopProxy proxy = new HadoopProxy(clusterSpec, cluster);
        InetAddress master = HamaCluster.getMasterPublicAddress(cluster);
        String script = String.format("echo 'Running proxy to Hama cluster at %s. " + "Use Ctrl-c to quit.'\n", master.getHostName()) + Joiner.on(" ").join(proxy.getProxyCommand());
        Files.write(script, hamaProxyFile, Charsets.UTF_8);
        LOG.info("Wrote Hama proxy script {}", hamaProxyFile);
    } catch (IOException e) {
        LOG.error("Problem writing Hama proxy script {}", hamaProxyFile, e);
    }
}
Also used : HadoopProxy(org.apache.whirr.service.hadoop.HadoopProxy) IOException(java.io.IOException) File(java.io.File) InetAddress(java.net.InetAddress)

Example 2 with HadoopProxy

use of org.apache.whirr.service.hadoop.HadoopProxy in project whirr by apache.

the class HamaServiceController method startup.

public synchronized void startup() throws Exception {
    LOG.info("Starting up cluster...");
    CompositeConfiguration config = new CompositeConfiguration();
    if (System.getProperty("config") != null) {
        config.addConfiguration(new PropertiesConfiguration(System.getProperty("config")));
    }
    config.addConfiguration(new PropertiesConfiguration(HamaServiceController.class.getResource("/whirr-hama-test.properties")));
    clusterSpec = ClusterSpec.withTemporaryKeys(config);
    controller = new ClusterController();
    cluster = controller.launchCluster(clusterSpec);
    proxy = new HadoopProxy(clusterSpec, cluster);
    proxy.start();
    HamaConfiguration conf = getConfiguration();
    BSPJobClient client = new BSPJobClient(conf);
    waitForGroomServers(client);
    running = true;
}
Also used : ClusterController(org.apache.whirr.ClusterController) BSPJobClient(org.apache.hama.bsp.BSPJobClient) CompositeConfiguration(org.apache.commons.configuration.CompositeConfiguration) HadoopProxy(org.apache.whirr.service.hadoop.HadoopProxy) HamaConfiguration(org.apache.hama.HamaConfiguration) PropertiesConfiguration(org.apache.commons.configuration.PropertiesConfiguration)

Example 3 with HadoopProxy

use of org.apache.whirr.service.hadoop.HadoopProxy in project whirr by apache.

the class HadoopServiceController method startup.

public synchronized void startup() throws Exception {
    LOG.info("Starting up cluster...");
    CompositeConfiguration config = new CompositeConfiguration();
    if (System.getProperty("config") != null) {
        config.addConfiguration(new PropertiesConfiguration(System.getProperty("config")));
    }
    config.addConfiguration(configuration);
    clusterSpec = ClusterSpec.withTemporaryKeys(config);
    controller = new ClusterController();
    cluster = controller.launchCluster(clusterSpec);
    proxy = new HadoopProxy(clusterSpec, cluster);
    proxy.start();
    Configuration conf = getConfiguration();
    JobConf job = new JobConf(conf, HadoopServiceController.class);
    JobClient client = new JobClient(job);
    waitToExitSafeMode(client);
    waitForTaskTrackers(client);
    running = true;
}
Also used : ClusterController(org.apache.whirr.ClusterController) CompositeConfiguration(org.apache.commons.configuration.CompositeConfiguration) Configuration(org.apache.hadoop.conf.Configuration) PropertiesConfiguration(org.apache.commons.configuration.PropertiesConfiguration) CompositeConfiguration(org.apache.commons.configuration.CompositeConfiguration) HadoopProxy(org.apache.whirr.service.hadoop.HadoopProxy) PropertiesConfiguration(org.apache.commons.configuration.PropertiesConfiguration) JobConf(org.apache.hadoop.mapred.JobConf) JobClient(org.apache.hadoop.mapred.JobClient)

Example 4 with HadoopProxy

use of org.apache.whirr.service.hadoop.HadoopProxy in project whirr by apache.

the class Cdh3HadoopServiceTest method setUp.

@BeforeClass
public static void setUp() throws Exception {
    CompositeConfiguration config = new CompositeConfiguration();
    if (System.getProperty("config") != null) {
        config.addConfiguration(new PropertiesConfiguration(System.getProperty("config")));
    }
    config.addConfiguration(new PropertiesConfiguration(getPropertiesFilename()));
    clusterSpec = ClusterSpec.withTemporaryKeys(config);
    controller = new ClusterController();
    cluster = controller.launchCluster(clusterSpec);
    proxy = new HadoopProxy(clusterSpec, cluster);
    proxy.start();
}
Also used : ClusterController(org.apache.whirr.ClusterController) CompositeConfiguration(org.apache.commons.configuration.CompositeConfiguration) HadoopProxy(org.apache.whirr.service.hadoop.HadoopProxy) PropertiesConfiguration(org.apache.commons.configuration.PropertiesConfiguration) BeforeClass(org.junit.BeforeClass)

Example 5 with HadoopProxy

use of org.apache.whirr.service.hadoop.HadoopProxy in project whirr by apache.

the class CdhYarnServiceTest method setUp.

@BeforeClass
public static void setUp() throws Exception {
    CompositeConfiguration config = new CompositeConfiguration();
    if (System.getProperty("config") != null) {
        config.addConfiguration(new PropertiesConfiguration(System.getProperty("config")));
    }
    config.addConfiguration(new PropertiesConfiguration(getPropertiesFilename()));
    clusterSpec = ClusterSpec.withTemporaryKeys(config);
    controller = new ClusterController();
    cluster = controller.launchCluster(clusterSpec);
    proxy = new HadoopProxy(clusterSpec, cluster);
    proxy.start();
}
Also used : ClusterController(org.apache.whirr.ClusterController) CompositeConfiguration(org.apache.commons.configuration.CompositeConfiguration) HadoopProxy(org.apache.whirr.service.hadoop.HadoopProxy) PropertiesConfiguration(org.apache.commons.configuration.PropertiesConfiguration) BeforeClass(org.junit.BeforeClass)

Aggregations

HadoopProxy (org.apache.whirr.service.hadoop.HadoopProxy)12 PropertiesConfiguration (org.apache.commons.configuration.PropertiesConfiguration)10 CompositeConfiguration (org.apache.commons.configuration.CompositeConfiguration)9 ClusterController (org.apache.whirr.ClusterController)9 Configuration (org.apache.hadoop.conf.Configuration)3 JobClient (org.apache.hadoop.mapred.JobClient)3 JobConf (org.apache.hadoop.mapred.JobConf)3 BeforeClass (org.junit.BeforeClass)3 File (java.io.File)2 IOException (java.io.IOException)2 InetAddress (java.net.InetAddress)2 HamaConfiguration (org.apache.hama.HamaConfiguration)1 BSPJobClient (org.apache.hama.bsp.BSPJobClient)1 Cluster (org.apache.whirr.Cluster)1 ClusterControllerFactory (org.apache.whirr.ClusterControllerFactory)1 ClusterSpec (org.apache.whirr.ClusterSpec)1 Service (org.apache.whirr.service.Service)1 ServiceFactory (org.apache.whirr.service.ServiceFactory)1 HadoopService (org.apache.whirr.service.hadoop.HadoopService)1 Before (org.junit.Before)1