Created 01-24-2017 05:53 AM
Can we schedule a sqoop incremental job ( sqoop job --exec IncJob) using oozie ?
Created 01-27-2017 05:22 AM
unfortunately , I don't any way for configuring sqoop incr jobs from oozie. So, had to write a shell script for the same.
#!/bin/bash if [ $# -ne 1 ]; then
echo "Not enough arguments to start the job,Synatx is Incr_jobs.sh arg1"
else sqoop job --exec $1 > sqooplog.txt 2>&1
fi
grep -i "Merge MapReduce job failed" sqooplog.txt if [ `echo $?` -eq 0 ] then
echo "`echo $1` job failed" | mailx -s "`echo $1` job failed" -a sqooplog.txt <mailid>
else echo "`echo $1` job completed successfully" | mailx -s "`echo $1` job completed successfully" <mailid>
fi
Created 01-24-2017 05:54 AM
My workflow.xml looks this way ...
<action name="sqoop-incr"> <sqoop xmlns="uri:oozie:sqoop-action:0.2"> <job-tracker>${jobTracker}</job-tracker> <name-node>${nameNode}</name-node> <configuration> <property> <name>mapred.job.queue.name</name> <value>${queueName}</value> </property> </configuration> <command>sqoop job --exec IncLocations</command> </sqoop> <ok to="end"/>
Error
Workflow Failed. Failing node [sqoop-incr] 2017-01-23 23:10:14,977 WARN ParameterVerifier:523 - SERVER[] USER[-] GROUP[-] TOKEN[-] APP[-] JOB[-] ACTION[-] The application does not define formal parameters in its XML definition
Created 01-27-2017 05:22 AM
unfortunately , I don't any way for configuring sqoop incr jobs from oozie. So, had to write a shell script for the same.
#!/bin/bash if [ $# -ne 1 ]; then
echo "Not enough arguments to start the job,Synatx is Incr_jobs.sh arg1"
else sqoop job --exec $1 > sqooplog.txt 2>&1
fi
grep -i "Merge MapReduce job failed" sqooplog.txt if [ `echo $?` -eq 0 ] then
echo "`echo $1` job failed" | mailx -s "`echo $1` job failed" -a sqooplog.txt <mailid>
else echo "`echo $1` job completed successfully" | mailx -s "`echo $1` job completed successfully" <mailid>
fi