Examples of runScriptOnNodesMatching()


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

      Iterables.get(nodes, 0).getCredentials().identity,
      clusterSpec.readPrivateKey());

    try {
      LOG.info("Running configuration script");
      Map<? extends NodeMetadata, ExecResponse> responses = computeService
          .runScriptOnNodesMatching(
            NodePredicates.runningWithTag(clusterSpec.getClusterName()),
              configureScript,
              RunScriptOptions.Builder.overrideCredentialsWith(credentials));
      assert responses.size() > 0 : "no nodes matched "
View Full Code Here

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

    ComputeServiceContext computeServiceContext = getCompute().apply(spec);
    ComputeService computeService = computeServiceContext.getComputeService();
    Cluster cluster = getClusterStateStore(spec).load();

    RunScriptOptions options = RunScriptOptions.Builder.runAsRoot(false).wrapInInitScript(false);
    return computeService.runScriptOnNodesMatching(Predicates.<NodeMetadata>and(condition, runningIn(cluster)), statement, options);
  }

  private Predicate<NodeMetadata> runningIn(Cluster cluster) {
    final Set<String> instanceIds = new HashSet<String>(Collections2.transform(cluster.getInstances(), new Function<Instance, String>() {
      @Override
View Full Code Here

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

    // Position is significant: i-th server has id i.
    String servers = Joiner.on(' ').join(getPrivateIps(nodes));
    byte[] configureScript = RunUrlBuilder.runUrls(
      "apache/zookeeper/post-configure " + servers);
    try {
      computeService.runScriptOnNodesMatching(runningWithTag(clusterSpec.getClusterName()), configureScript);
    } catch (RunScriptOnNodesException e) {
      // TODO: retry
      throw new IOException(e);
    }
   
View Full Code Here

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

    String servers = Joiner.on(' ').join(getPrivateIps(seeds));
    byte[] configureScript = RunUrlBuilder
        .runUrls("apache/cassandra/post-configure " + servers);

    try {
      Map<? extends NodeMetadata, ExecResponse> responses = computeService
          .runScriptOnNodesMatching(
              runningWithTag(clusterSpec.getClusterName()), configureScript);
      assert responses.size() > 0 : "no nodes matched "
          + clusterSpec.getClusterName();
    } catch (RunScriptOnNodesException e) {
View Full Code Here

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

    ComputeServiceContext computeServiceContext = getCompute().apply(spec);
    ComputeService computeService = computeServiceContext.getComputeService();
    Cluster cluster = getClusterStateStore(spec).load();

    RunScriptOptions options = RunScriptOptions.Builder.runAsRoot(false).wrapInInitScript(false);
    return computeService.runScriptOnNodesMatching(Predicates.<NodeMetadata>and(condition, runningIn(cluster)), statement, options);
  }

  private Predicate<NodeMetadata> runningIn(Cluster cluster) {
    final Set<String> instanceIds = new HashSet<String>(Collections2.transform(cluster.getInstances(), new Function<Instance, String>() {
      @Override
View Full Code Here

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

          clusterSpec.readPrivateKey());
      try {
        LOG.info("Running configuration script");
        Payload script = newStringPayload(statementBuilder.render(OsFamily.UNIX));
        LOG.debug("Running script:\n{}", script.getRawContent());
        computeService.runScriptOnNodesMatching(
            toNodeMetadataPredicate(clusterSpec, cluster, entry.getKey().getRoles()),
            script,
            RunScriptOptions.Builder.overrideCredentialsWith(credentials));
        LOG.info("Configuration script run completed");
      } catch (RunScriptOnNodesException e) {
View Full Code Here

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

          clusterSpec.getPrivateKey());
      try {
        LOG.info("Running configuration script");
        if (LOG.isDebugEnabled())
          LOG.debug("Running script:\n{}", statementBuilder.render(OsFamily.UNIX));
        computeService.runScriptOnNodesMatching(
            toNodeMetadataPredicate(clusterSpec, cluster, entry.getKey().getRoles()),
            statementBuilder,
            RunScriptOptions.Builder.overrideCredentialsWith(credentials));
        LOG.info("Configuration script run completed");
      } catch (RunScriptOnNodesException e) {
View Full Code Here

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

        @Override
        public Void call() throws Exception {
          LOG.info("Running script");
          if (LOG.isDebugEnabled())
            LOG.debug("Running script:\n{}", statementBuilder.render(OsFamily.UNIX));
          computeService.runScriptOnNodesMatching(
              Predicates.in(templateNodes),
              statementBuilder);
          LOG.info("Script run completed");
          return null;
        }
View Full Code Here

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

        LOG.info("Running configuration script on nodes: {}", nodesToApply.keySet());
        if (LOG.isDebugEnabled())
          LOG.debug("script:\n{}", statementBuilder.render(OsFamily.UNIX));
       
        computeService.runScriptOnNodesMatching(
            withIds(nodesToApply.keySet()),
            statementBuilder,
            RunScriptOptions.Builder.overrideCredentialsWith(credentials)
        );
       
View Full Code Here

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

        @Override
        public Void call() throws Exception {
          LOG.info("Running script");
          if (LOG.isDebugEnabled())
            LOG.debug("Running script:\n{}", statementBuilder.render(OsFamily.UNIX));
          computeService.runScriptOnNodesMatching(
              Predicates.in(templateNodes),
              statementBuilder);
          LOG.info("Script run completed");
          return null;
        }
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.