Package org.apache.hadoop.util

Examples of org.apache.hadoop.util.SSHRemoteExecution


      this.hostName = hostName;
      this.cmd = cmd;
    }
    public void run() {
      try {
        RemoteExecution rExec = new SSHRemoteExecution();
        rExec.executeCommand(hostName, userName, cmd);
        exitStatus = true;
      } catch(InterruptedException iexp) {
        LOG.warn("Thread is interrupted:" + iexp.getMessage());
        exitStatus = false;
      } catch(Exception exp) {
View Full Code Here


    //when a job's task starts.
    for ( int i = 0;i < ttClients.size();i++ ) {
      TTClient ttClient = (TTClient)ttClients.get(i);
      String ttClientHostName = ttClient.getHostName();
      try {
        RemoteExecution rExec = new SSHRemoteExecution();
        rExec.executeCommand(ttClientHostName, userName,
          replaceTaskControllerCommand);
      } catch (Exception e) { e.printStackTrace(); };
    }

    conf = cluster.getJTClient().getProxy().getDaemonConf();
View Full Code Here

    //The client which needs to be decommissioned is put in the exclude path.
    String command = "echo " + ttClientHostName + " > " + excludeHostPath;
    LOG.info("command is : " + command);
    RemoteExecution rExec = new SSHRemoteExecution();
    rExec.executeCommand(jtClientHostName, userName, command);

    //The refreshNode command is created and execute in Job Tracker Client.
    String refreshNodeCommand = "export HADOOP_CONF_DIR=" + hadoopConfDir +
        "; export HADOOP_HOME=" + hadoopHomeDir + ";cd " + hadoopHomeDir +
        ";kinit -k -t " + keytabForHadoopqaUser +
        ";bin/hadoop mradmin -refreshNodes;";
    LOG.info("refreshNodeCommand is : " + refreshNodeCommand);
    try {
      rExec.executeCommand(testRunningHostName, userName,
          refreshNodeCommand);
    } catch (Exception e) { e.printStackTrace();}

    //Checked whether the node is really decommissioned.
    boolean nodeDecommissionedOrNot = false;
    nodeDecommissionedOrNot = remoteJTClientProxy.
        isNodeDecommissioned(ttClientHostName);

    //The TTClient host is removed from the exclude path
    command = "rm " + excludeHostPath;

    LOG.info("command is : " + command);
    rExec.executeCommand(jtClientHostName, userName, command);

    Assert.assertTrue("Node should be decommissioned", nodeDecommissionedOrNot);

    //The refreshNode command is created and execute in Job Tracker Client.
    rExec.executeCommand(jtClientHostName, userName,
        refreshNodeCommand);

    //Checked whether the node is out of decommission.
    nodeDecommissionedOrNot = false;
    nodeDecommissionedOrNot = remoteJTClientProxy.
        isNodeDecommissioned(ttClientHostName);
    Assert.assertFalse("present of not is", nodeDecommissionedOrNot);

    //Starting that node
    String ttClientStart = "export HADOOP_CONF_DIR=" + hadoopConfDir +
        "; export HADOOP_HOME=" + hadoopHomeDir + ";cd " + hadoopHomeDir +
        ";kinit -k -t " + keytabForHadoopqaUser +
        ";bin/hadoop-daemons.sh start tasktracker;";
    LOG.info("ttClientStart is : " + ttClientStart);
    rExec.executeCommand(jtClientHostName, userName,
        ttClientStart);
  }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.util.SSHRemoteExecution

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.