Package org.apache.whirr.service

Examples of org.apache.whirr.service.ClusterSpec$InstanceTemplate


    return ROLE;
  }

  @Override
  protected void beforeBootstrap(ClusterActionEvent event) throws IOException {
    ClusterSpec clusterSpec = event.getClusterSpec();   
    addStatement(event, call("configure_hostnames",
      HBaseConstants.PARAM_PROVIDER, clusterSpec.getProvider()));
    addStatement(event, call("install_java"));
    addStatement(event, call("install_tarball"));
    String hbaseInstallFunction = getConfiguration(clusterSpec).getString(
      HBaseConstants.KEY_INSTALL_FUNCTION, HBaseConstants.FUNCTION_INSTALL);
    String tarurl = getConfiguration(clusterSpec).getString(
      HBaseConstants.KEY_TARBALL_URL);
    addStatement(event, call(hbaseInstallFunction,
      HBaseConstants.PARAM_PROVIDER, clusterSpec.getProvider(),
      HBaseConstants.PARAM_TARBALL_URL, tarurl));
  }
View Full Code Here


  }

  @Override
  protected void beforeConfigure(ClusterActionEvent event)
      throws IOException, InterruptedException {
    ClusterSpec clusterSpec = event.getClusterSpec();
    Cluster cluster = event.getCluster();

    Instance instance = cluster.getInstanceMatching(
      role(HBaseMasterClusterActionHandler.ROLE));
    InetAddress masterPublicAddress = instance.getPublicAddress();

    ComputeServiceContext computeServiceContext =
      ComputeServiceContextBuilder.build(clusterSpec);
    FirewallSettings.authorizeIngress(computeServiceContext, instance, clusterSpec,
      REGIONSERVER_WEB_UI_PORT);
    FirewallSettings.authorizeIngress(computeServiceContext, instance, clusterSpec,
      REGIONSERVER_PORT);

    String hbaseConfigureFunction = getConfiguration(clusterSpec).getString(
      HBaseConstants.KEY_CONFIGURE_FUNCTION,
      HBaseConstants.FUNCTION_POST_CONFIGURE);
    String master = DnsUtil.resolveAddress(masterPublicAddress.getHostAddress());
    String quorum = ZooKeeperCluster.getHosts(cluster);
    String tarurl = getConfiguration(clusterSpec).getString(
      HBaseConstants.KEY_TARBALL_URL);  
    addStatement(event, call(hbaseConfigureFunction, ROLE,
      HBaseConstants.PARAM_MASTER, master,
      HBaseConstants.PARAM_QUORUM, quorum,
      HBaseConstants.PARAM_PROVIDER, clusterSpec.getProvider(),
      HBaseConstants.PARAM_TARBALL_URL, tarurl));
  }
View Full Code Here

    return role;
  }

  @Override
  protected void beforeBootstrap(ClusterActionEvent event) throws IOException {
    ClusterSpec clusterSpec = event.getClusterSpec();   
    addStatement(event, call("configure_hostnames",
      HBaseConstants.PARAM_PROVIDER, clusterSpec.getProvider()));
    addStatement(event, call("install_java"));
    addStatement(event, call("install_tarball"));
    String hbaseInstallFunction = getConfiguration(clusterSpec).getString(
      HBaseConstants.KEY_INSTALL_FUNCTION, HBaseConstants.FUNCTION_INSTALL);
    String tarurl = getConfiguration(clusterSpec).getString(
      HBaseConstants.KEY_TARBALL_URL);
    addStatement(event, call(hbaseInstallFunction,
      HBaseConstants.PARAM_PROVIDER, clusterSpec.getProvider(),
      HBaseConstants.PARAM_TARBALL_URL, tarurl));
  }
View Full Code Here

  }

  @Override
  protected void beforeConfigure(ClusterActionEvent event)
      throws IOException, InterruptedException {
    ClusterSpec clusterSpec = event.getClusterSpec();
    Cluster cluster = event.getCluster();
    int port = defaultPort;
    if (configKeyPort != null) {
      port = getConfiguration(clusterSpec).getInt(configKeyPort, defaultPort);
    }

    Cluster.Instance instance = cluster.getInstanceMatching(
      role(HBaseMasterClusterActionHandler.ROLE));
    InetAddress masterPublicAddress = instance.getPublicAddress();

    ComputeServiceContext computeServiceContext =
      ComputeServiceContextBuilder.build(clusterSpec);
    FirewallSettings.authorizeIngress(computeServiceContext, instance,
      clusterSpec, port);

    String hbaseConfigureFunction = getConfiguration(clusterSpec).getString(
      HBaseConstants.KEY_CONFIGURE_FUNCTION,
      HBaseConstants.FUNCTION_POST_CONFIGURE);
    String master = DnsUtil.resolveAddress(masterPublicAddress.getHostAddress());
    String quorum = ZooKeeperCluster.getHosts(cluster);
    String tarurl = getConfiguration(clusterSpec).getString(
      HBaseConstants.KEY_TARBALL_URL);  
    addStatement(event, call(hbaseConfigureFunction, role,
      HBaseConstants.PARAM_MASTER, master,
      HBaseConstants.PARAM_QUORUM, quorum,
      HBaseConstants.PARAM_PORT, Integer.toString(port),
      HBaseConstants.PARAM_PROVIDER, clusterSpec.getProvider(),
      HBaseConstants.PARAM_TARBALL_URL, tarurl));
  }
View Full Code Here

    return ROLE;
  }

  @Override
  protected void beforeBootstrap(ClusterActionEvent event) throws IOException {
    ClusterSpec clusterSpec = event.getClusterSpec();  
    addStatement(event, call("configure_hostnames", "-c", clusterSpec.getProvider()));
    String hadoopInstallFunction = clusterSpec.getConfiguration().getString(
        "whirr.hadoop-install-function", "install_hadoop");
    addStatement(event, call("install_java"));
    addStatement(event, call("install_tarball"));
    addStatement(event, call(hadoopInstallFunction, "-c", clusterSpec.getProvider()));
  }
View Full Code Here

  }
 
  @Override
  protected void beforeConfigure(ClusterActionEvent event)
      throws IOException, InterruptedException {
    ClusterSpec clusterSpec = event.getClusterSpec();
    Cluster cluster = event.getCluster();
   
    Instance instance = cluster.getInstanceMatching(
        role(HadoopNameNodeClusterActionHandler.ROLE));
    InetAddress namenodePublicAddress = instance.getPublicAddress();
    InetAddress jobtrackerPublicAddress = namenodePublicAddress;
   
    try {
      event.getStatementBuilder().addStatements(
        buildCommon("/tmp/core-site.xml", clusterSpec, cluster),
        buildHdfs("/tmp/hdfs-site.xml", clusterSpec, cluster),
        buildMapReduce("/tmp/mapred-site.xml", clusterSpec, cluster)
      );
    } catch (ConfigurationException e) {
      throw new IOException(e);
    }

    String hadoopConfigureFunction = clusterSpec.getConfiguration().getString(
        "whirr.hadoop-configure-function", "configure_hadoop");
    addStatement(event, call(hadoopConfigureFunction,
        "hadoop-datanode,hadoop-tasktracker",
        "-c", clusterSpec.getProvider()
    ));
  }
View Full Code Here

    addStatement(event, call("install_zookeeper"));
  }

  @Override
  protected void beforeConfigure(ClusterActionEvent event) throws IOException, InterruptedException {
    ClusterSpec clusterSpec = event.getClusterSpec();
    Cluster cluster = event.getCluster();
    LOG.info("Authorizing firewall");
    ComputeServiceContext computeServiceContext =
      ComputeServiceContextBuilder.build(clusterSpec);
    FirewallSettings.authorizeIngress(computeServiceContext,
        cluster.getInstances(), clusterSpec, CLIENT_PORT);
   
    // Pass list of all servers in ensemble to configure script.
    // Position is significant: i-th server has id i.
    String servers = Joiner.on(' ').join(getPrivateIps(cluster.getInstancesMatching(
      RolePredicates.role(ZooKeeperClusterActionHandler.ZOOKEEPER_ROLE))));
    addStatement(event, call("configure_zookeeper", "-c",
        clusterSpec.getProvider(), servers));
  }
View Full Code Here

        clusterSpec.getProvider(), servers));
  }
 
  @Override
  protected void afterConfigure(ClusterActionEvent event) {
    ClusterSpec clusterSpec = event.getClusterSpec();
    Cluster cluster = event.getCluster();
    LOG.info("Completed configuration of {}", clusterSpec.getClusterName());
    String hosts = Joiner.on(',').join(getHosts(cluster.getInstancesMatching(
      RolePredicates.role(ZooKeeperClusterActionHandler.ZOOKEEPER_ROLE))));
    LOG.info("Hosts: {}", hosts);
  }
View Full Code Here

  }

  @Override
  protected void beforeConfigure(ClusterActionEvent event)
      throws IOException, InterruptedException {
    ClusterSpec clusterSpec = event.getClusterSpec();
    Cluster cluster = event.getCluster();
    LOG.info("Authorizing firewall");
    ComputeServiceContext computeServiceContext =
      ComputeServiceContextBuilder.build(clusterSpec);
    FirewallSettings.authorizeIngress(computeServiceContext,
        cluster.getInstances(), clusterSpec, CLIENT_PORT);
    FirewallSettings.authorizeIngress(computeServiceContext,
        cluster.getInstances(), clusterSpec, JMX_PORT);
   
    List<Instance> seeds = getSeeds(cluster.getInstances());
    String servers = Joiner.on(' ').join(getPrivateIps(seeds));
    addStatement(event, call("configure_cassandra", "-c",
        clusterSpec.getProvider(), servers));
  }
View Full Code Here

    Map<InstanceTemplate, Future<Set<? extends NodeMetadata>>> futures = Maps.newHashMap();
   
    // initialize startup processes per InstanceTemplates
    for (Entry<InstanceTemplate, ClusterActionEvent> entry : eventMap.entrySet()) {
      final InstanceTemplate instanceTemplate = entry.getKey();
      final ClusterSpec clusterSpec = entry.getValue().getClusterSpec();
      final int maxNumberOfRetries = clusterSpec.getMaxStartupRetries();
      StatementBuilder statementBuilder = entry.getValue().getStatementBuilder();
      ComputeServiceContext computeServiceContext =
        ComputeServiceContextBuilder.build(getComputeServiceContextFactory(), clusterSpec);
      final ComputeService computeService =
        computeServiceContext.getComputeService();
      final Template template = buildTemplate(clusterSpec, computeService,
          statementBuilder, entry.getValue().getTemplateBuilderStrategy());
     
      Future<Set<? extends NodeMetadata>> nodesFuture = executorService.submit(
          new StartupProcess(
              clusterSpec.getClusterName(),
              instanceTemplate.getNumberOfInstances(),
              instanceTemplate.getMinNumberOfInstances(),
              maxNumberOfRetries,
              instanceTemplate.getRoles(),
              computeService, template, executorService, nodeStarterFactory));
View Full Code Here

TOP

Related Classes of org.apache.whirr.service.ClusterSpec$InstanceTemplate

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.