Community Articles
Find and share helpful community-sourced technical articles
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.
Labels (1)

while running the sqoop command from the java program with -verbose option can result into race condition during obtaining lock on the console appender.we can workaround this with the help of SSHXCUTE framework which will create java program and sqoop command context separately.

ENV: HDP 2.4

Java Version : JDK-8

Step 1: download sshxcute jar from

Step 2: Create

import net.neoremind.sshxcute.core.SSHExec;
import net.neoremind.sshxcute.core.ConnBean;
import net.neoremind.sshxcute.task.CustomTask;
import net.neoremind.sshxcute.task.impl.ExecCommand;

public class RunSqoopCommand {

public static void main(String args[]) throws Exception{

    ConnBean cb = new ConnBean("localhost", "root","hadoop");

    SSHExec ssh = SSHExec.getInstance(cb);          
    CustomTask sqoopCommand = new ExecCommand("sqoop import -Dorg.apache.sqoop.splitter.allow_text_splitter=true  
                                     --connect jdbc:oracle:thin:@ 
                                              --table TEST_INCREMENTAL -m 1 --username system 
                                              --password oracle --target-dir 

Step 3: compile program

javac -cp sshxcute-1.0.jar

Step 4: Run program

java -cp sshxcute-1.0.jar RunSqoopCommand

Don't have an account?
Coming from Hortonworks? Activate your account here
Version history
Revision #:
1 of 1
Last update:
‎12-20-2016 02:19 PM
Updated by:
Top Kudoed Authors