Package org.apache.whirr.Cluster

Examples of org.apache.whirr.Cluster.Instance


    ClusterSpec clusterSpec = event.getClusterSpec();
    Cluster cluster = event.getCluster();
    Configuration conf = getConfiguration(clusterSpec);

    LOG.info("Authorizing firewall");
    Instance instance = cluster.getInstanceMatching(role(ROLE));
    InetAddress masterPublicAddress = instance.getPublicAddress();

    event.getFirewallManager().addRules(
      Rule.create()
        .destination(instance)
        .ports(MASTER_WEB_UI_PORT, MASTER_PORT)
View Full Code Here


        "-u", tarball));
  }
 
  protected Map<String, String> getDeviceMappings(ClusterActionEvent event) {
      Set<Instance> instances = event.getCluster().getInstancesMatching(RolePredicates.role(getRole()));
      Instance prototype = Iterables.getFirst(instances, null);
      if (prototype == null) {
          throw new IllegalStateException("No instances found in role " + getRole());
      }
      VolumeManager volumeManager = new VolumeManager();
      return volumeManager.getDeviceMappings(event.getClusterSpec(), prototype);
View Full Code Here

    Cluster cluster = event.getCluster();

    // TODO: wait for regionservers to come up?

    LOG.info("Completed configuration of {}", clusterSpec.getClusterName());
    Instance instance = cluster.getInstanceMatching(role(ROLE));
    InetAddress masterPublicAddress = instance.getPublicAddress();

    LOG.info("Web UI available at http://{}", masterPublicAddress.getHostName());
    String quorum = ZooKeeperCluster.getHosts(cluster);
    Properties config = createClientSideProperties(masterPublicAddress, quorum);
    createClientSideHadoopSiteFile(clusterSpec, config);
View Full Code Here

      throws IOException, InterruptedException {
    ClusterSpec clusterSpec = event.getClusterSpec();
    Cluster cluster = event.getCluster();
    Configuration conf = getConfiguration(clusterSpec);

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

    event.getFirewallManager().addRules(
      Rule.create()
        .destination(instance)
        .ports(REGIONSERVER_WEB_UI_PORT, REGIONSERVER_PORT)
View Full Code Here

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

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

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

  @Override
  protected void beforeConfigure(ClusterActionEvent event) throws IOException {
    Instance kerberosServerInstance = null;
    try {
      kerberosServerInstance = event.getCluster().getInstanceMatching(role(KerberosServerHandler.ROLE));
    } catch (NoSuchElementException noSuchElementException) {
      // ignore exception which a indicates client role has been configured
      // without a cluster KDC role, but ensure the configure client script is
      // not executed, which depends on the KDC hostname
    }
    if (kerberosServerInstance != null) {
      addStatement(event, call("configure_kerberos_client", "-h", kerberosServerInstance.getPublicHostName()));
    }
  }
View Full Code Here

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

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

    event.getFirewallManager().addRules(
        Rule.create().destination(instance).ports(GROOMSERVER_PORT));

    handleFirewallRules(event);
View Full Code Here

      InterruptedException {
    ClusterSpec clusterSpec = event.getClusterSpec();
    Cluster cluster = event.getCluster();

    LOG.info("Authorizing firewall");
    Instance instance = cluster.getInstanceMatching(role(ROLE));
    InetAddress masterPublicAddress = instance.getPublicAddress();

    event.getFirewallManager().addRules(
        Rule.create().destination(instance).ports(MASTER_WEB_UI_PORT),
        Rule.create().destination(instance).ports(MASTER_PORT));
View Full Code Here

  protected void afterConfigure(ClusterActionEvent event) throws IOException {
    ClusterSpec clusterSpec = event.getClusterSpec();
    Cluster cluster = event.getCluster();

    LOG.info("Completed configuration of {}", clusterSpec.getClusterName());
    Instance instance = cluster.getInstanceMatching(role(ROLE));
    InetAddress masterPublicAddress = instance.getPublicAddress();

    LOG.info("BSPMaster web UI available at http://{}:{}", masterPublicAddress
        .getHostName(), MASTER_WEB_UI_PORT);

    String quorum = ZooKeeperCluster.getHosts(cluster);
View Full Code Here

TOP

Related Classes of org.apache.whirr.Cluster.Instance

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.