Member since
07-28-2018
3
Posts
0
Kudos Received
0
Solutions
08-03-2018
12:56 PM
@Steven Matison I made it work by passing sqoop command as arguments in workflow.xml. Please have a look at my workflow.xml and job.properties file. This is working absolutely fine. job.properties: nameNode=hdfs://(namenode):8020
jobTracker=(resourcemanager):8050/8032
queueName=default
oozieExecutionFolder=oozietest/sqoop
oozie.use.system.libpath=true
oozie.wf.application.path=${nameNode}/user/${user.name}/${oozieExecutionFolder}
workflow.xml: <?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<workflow-app xmlns="uri:oozie:workflow:0.2" name="sqoop-wf">
<start to="sqoop-node"/>
<action name="sqoop-node">
<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>!-->
<!-- <arg>sudo -u bigdata2tpn</arg>!-->
<arg>import</arg>
<arg>--connect</arg>
<arg>jdbc:postgresql://ipaddress:5432/c00026</arg>
<arg>--username</arg>
<arg>postgres</arg>
<arg>--password</arg>
<arg>password</arg>
<arg>--target-dir</arg>
<arg>hdfs://namenode:8020/user/bigdata2tpn/sqoop_job_oozie</arg>
<arg>--table</arg>
<arg>sqoop_job</arg>
<arg>-m</arg>
<arg>1</arg>
<arg>--check-column</arg>
<arg>id</arg>
<arg>--incremental</arg>
<arg>append</arg>
<arg>--last-value</arg>
<arg>0</arg>
<file>hdfs://namenode:8020/user/oozie/share/lib/lib_20180703052502/sqoop/postgresql-9.2-1002.jdbc4.jar</file>
<file>hdfs://namenode:8020/user/oozie/share/lib/lib_20180703052502/sqoop/sqoop-1.4.6.2.6.5.0-292.jar</file>
</sqoop>
<ok to="end"/>
<error to="fail"/>
</action>
<kill name="fail">
<message>Sqoop failed, error message[${wf:errorMessage(wf:lastErrorNode())}]</message>
</kill>
<end name="end"/>
</workflow-app>
Note: sqoop commands should be passed within arguments otherwise job will not run. Additionaly you have to mention postgresql driver jar file path inside file tag in workflow.xml. The given configuration is more than enough to run oozie-sqoop job successfully. Good to go !! 🙂
... View more