Package org.apache.whirr.service.hadoop

Examples of org.apache.whirr.service.hadoop.HadoopProxy


  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);
    }
View Full Code Here


  private void createProxyScript(ClusterSpec clusterSpec, Cluster cluster) {
    File configDir = getConfigDir(clusterSpec);
    File hbaseProxyFile = new File(configDir, "hbase-proxy.sh");
    try {
      HadoopProxy proxy = new HadoopProxy(clusterSpec, cluster);
      InetAddress master = HBaseCluster.getMasterPublicAddress(cluster);
      String script = String.format("echo 'Running proxy to HBase cluster at %s. " +
        "Use Ctrl-c to quit.'\n", master.getHostName())
        + Joiner.on(" ").join(proxy.getProxyCommand());
      Files.write(script, hbaseProxyFile, Charsets.UTF_8);
      LOG.info("Wrote HBase proxy script {}", hbaseProxyFile);
    } catch (IOException e) {
      LOG.error("Problem writing HBase proxy script {}", hbaseProxyFile, e);
    }
View Full Code Here

    ClusterController controller = factory.create(spec.getServiceName());

    /**
     * Start the cluster as defined in the configuration file
     */
    HadoopProxy proxy = null;
    try {
      LOG.info("Starting cluster {}", spec.getClusterName());
      Cluster cluster = controller.launchCluster(spec);

      LOG.info("Starting local SOCKS proxy");
      proxy = new HadoopProxy(spec, cluster);
      proxy.start();

      /**
       * Obtain a Hadoop configuration object and wait for services to start
       */
      Configuration config = getHadoopConfiguration(cluster);
      JobConf job = new JobConf(config, HadoopClusterExample.class);
      JobClient client = new JobClient(job);

      waitToExitSafeMode(client);
      waitForTaskTrackers(client);

      /**
       * Run a simple job to show that the cluster is available for work.
       */

      runWordCountingJob(config);

    } finally {
      /**
       * Stop the proxy and terminate all the cluster instances.
       */
      if (proxy != null) {
        proxy.stop();
      }
      controller.destroyCluster(spec);
      return 0;
    }
  }
View Full Code Here

    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, HadoopServiceTest.class);
    JobClient client = new JobClient(job);
View Full Code Here

    config.addConfiguration(new PropertiesConfiguration("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);
View Full Code Here

    config.addConfiguration(new PropertiesConfiguration(getPropertiesFilename()));
    clusterSpec = ClusterSpec.withTemporaryKeys(config);
    controller = new ClusterController();
   
    cluster = controller.launchCluster(clusterSpec);
    proxy = new HadoopProxy(clusterSpec, cluster);
    proxy.start();
  }
View Full Code Here

  private void createProxyScript(ClusterSpec clusterSpec, Cluster cluster) {
    File configDir = getConfigDir(clusterSpec);
    File hbaseProxyFile = new File(configDir, "hbase-proxy.sh");
    try {
      HadoopProxy proxy = new HadoopProxy(clusterSpec, cluster);
      InetAddress master = HBaseCluster.getMasterPublicAddress(cluster);
      String script = String.format("echo 'Running proxy to HBase cluster at %s. " +
        "Use Ctrl-c to quit.'\n",
        DnsUtil.resolveAddress(master.getHostAddress()))
        + Joiner.on(" ").join(proxy.getProxyCommand());
      Files.write(script, hbaseProxyFile, Charsets.UTF_8);
      LOG.info("Wrote HBase proxy script {}", hbaseProxyFile);
    } catch (IOException e) {
      LOG.error("Problem writing HBase proxy script {}", hbaseProxyFile, e);
    }
View Full Code Here

    config.addConfiguration(new PropertiesConfiguration("whirr-hbase-test.properties"));
    clusterSpec = ClusterSpec.withTemporaryKeys(config);
    service = new Service();

    cluster = service.launchCluster(clusterSpec);
    proxy = new HadoopProxy(clusterSpec, cluster);
    proxy.start();

    Configuration conf = getConfiguration();

    InetAddress restAddress = cluster.getInstanceMatching(RolePredicates.role(
View Full Code Here

TOP

Related Classes of org.apache.whirr.service.hadoop.HadoopProxy

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.