Examples of runScriptOnNodesMatching()


Examples of org.apache.whirr.ClusterController.runScriptOnNodesMatching()

    ClusterController controller =
      (new ClusterControllerFactory()).create(spec.getServiceName());

    try {
      controller.launchCluster(spec);
      Map<? extends NodeMetadata, ExecResponse> responseMap = controller.runScriptOnNodesMatching(
        spec,
        Predicates.<NodeMetadata>alwaysTrue(),
        exec("cat /tmp/bootstrap-start /tmp/bootstrap-end /tmp/configure-start")
      );
      ExecResponse response = Iterables.get(responseMap.values(), 0);
View Full Code Here

Examples of org.apache.whirr.ClusterController.runScriptOnNodesMatching()

                 ClusterSpec clusterSpec, String[] instances, String[] roles,
                 String fileName) throws Exception {
    ClusterController controller = createClusterController(clusterSpec.getServiceName());
    Predicate<NodeMetadata> condition = buildFilterPredicate(instances, roles, clusterSpec);

    return handleScriptOutput(out, err, controller.runScriptOnNodesMatching(
      clusterSpec, condition, execFile(fileName)));
  }

  private Predicate<NodeMetadata> buildFilterPredicate(String[] ids, String[] roles, ClusterSpec spec)
    throws IOException {
View Full Code Here

Examples of org.apache.whirr.ClusterController.runScriptOnNodesMatching()

      ClusterSpec spec = getClusterSpec(optionSet);
      ClusterController controller = createClusterController(spec.getServiceName());

      Predicate<NodeMetadata> condition = buildFilterPredicate(optionSet, spec);

      return handleScriptOutput(out, err, controller.runScriptOnNodesMatching(
        spec, condition, execFile(optionSet.valueOf(scriptOption))));

    } catch(IllegalArgumentException e) {
      err.println(e.getMessage());
      printUsage(parser, err);
View Full Code Here

Examples of org.apache.whirr.ClusterController.runScriptOnNodesMatching()

      ClusterSpec spec = getClusterSpec(optionSet);
      ClusterController controller = createClusterController(spec.getServiceName());

      Predicate<NodeMetadata> condition = buildFilterPredicate(optionSet, spec);

      return handleScriptOutput(out, err, controller.runScriptOnNodesMatching(
        spec, condition, execFile(optionSet.valueOf(scriptOption))));

    } catch(IllegalArgumentException e) {
      err.println(e.getMessage());
      printUsage(parser, err);
View Full Code Here

Examples of org.apache.whirr.ClusterController.runScriptOnNodesMatching()

      ClusterSpec spec = getClusterSpec(optionSet);
      ClusterController controller = createClusterController(spec.getServiceName());

      Predicate<NodeMetadata> condition = buildFilterPredicate(optionSet, spec);

      return handleScriptOutput(out, err, controller.runScriptOnNodesMatching(
        spec, condition, execFile(optionSet.valueOf(scriptOption))));

    } catch(IllegalArgumentException e) {
      err.println(e.getMessage());
      printUsage(parser, err);
View Full Code Here

Examples of org.apache.whirr.ClusterController.runScriptOnNodesMatching()

    ClusterController controller =
      (new ClusterControllerFactory()).create(spec.getServiceName());

    try {
      controller.launchCluster(spec);
      Map<? extends NodeMetadata, ExecResponse> responseMap = controller.runScriptOnNodesMatching(
        spec,
        Predicates.<NodeMetadata>alwaysTrue(),
        exec("cat /tmp/bootstrap-start /tmp/bootstrap-end /tmp/configure-start")
      );
      ExecResponse response = Iterables.get(responseMap.values(), 0);
View Full Code Here

Examples of org.jclouds.compute.ComputeService.runScriptOnNodesMatching()

         }

         Map<? extends NodeMetadata, ExecResponse> responseMap = null;

          if (getScript() != null) {
              responseMap = service.runScriptOnNodesMatching(getNodeFilter(),
                      getScript(), overrideLoginCredentials(credentials).runAsRoot(runAsRoot()));
          } else if (getStatement() != null) {
             responseMap = service.runScriptOnNodesMatching(getNodeFilter(),
                      getStatement(), overrideLoginCredentials(credentials).runAsRoot(runAsRoot()));
          }
View Full Code Here

Examples of org.jclouds.compute.ComputeService.runScriptOnNodesMatching()

          if (getScript() != null) {
              responseMap = service.runScriptOnNodesMatching(getNodeFilter(),
                      getScript(), overrideLoginCredentials(credentials).runAsRoot(runAsRoot()));
          } else if (getStatement() != null) {
             responseMap = service.runScriptOnNodesMatching(getNodeFilter(),
                      getStatement(), overrideLoginCredentials(credentials).runAsRoot(runAsRoot()));
          }

          for (Map.Entry<? extends NodeMetadata, ExecResponse> entry : responseMap.entrySet()) {
            ExecResponse response = entry.getValue();
View Full Code Here

Examples of org.jclouds.compute.ComputeService.runScriptOnNodesMatching()

        if (useConfiguredPrivateKey(config)) {
            loginBuilder.privateKey(Files.toString(new File(config.getPrivateKeyFile()), Charset.defaultCharset()));
        }

        computeService.runScriptOnNodesMatching(runningInGroup(config.getTagPrefix() + id),
                Statements.exec(buildStartupScript(id, config)),
                RunScriptOptions.Builder.blockOnComplete(false).overrideLoginCredentials(loginBuilder.build()));
    }

    private boolean useConfiguredPrivateKey(JcloudsNodeLauncherConfig config) {
View Full Code Here

Examples of org.jclouds.compute.ComputeService.runScriptOnNodesMatching()

    Credentials credentials = new Credentials(
      Iterables.get(nodes, 0).getCredentials().identity,
      clusterSpec.readPrivateKey());
    try {
      LOG.info("Running configuration script");
      computeService.runScriptOnNodesMatching(NodePredicates.runningWithTag(
          clusterSpec.getClusterName()),
          configureScript,
          RunScriptOptions.Builder.overrideCredentialsWith(credentials));
    } catch (RunScriptOnNodesException e) {
      // TODO: retry
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.