Support Questions

Find answers, ask questions, and share your expertise

Can we schedule a sqoop incremental job ( sqoop job --exec IncJob) using oozie ?

avatar
Super Collaborator

Can we schedule a sqoop incremental job ( sqoop job --exec IncJob) using oozie ?

1 ACCEPTED SOLUTION

avatar
Super Collaborator

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

View solution in original post

2 REPLIES 2

avatar
Super Collaborator

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

avatar
Super Collaborator

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