Support Questions
Find answers, ask questions, and share your expertise

I am getting error in oozie workflow what I have done wrong?

I am getting error in oozie workflow what I have done wrong?

I have trouble getting prepared oozie workflow for shell script for sqoop. I created job.properties and workflow.xml file but I am getting error:-

Note:- job.properties and workflow.xml files I am putting same location locally is it right?

-------------- script.sh---------

#!/bin/bash -e

sqoop import --connect jdbc:mysql://localhost:3306/test --username newuser --password password --table DRIVERS --hive-import --hive-table sample.DRIVERS -m 1 --driver com.mysql.jdbc.Driver

sqoop import --connect jdbc:mysql://localhost:3306/test --username newuser --password password --table TIMESHEET --hive-import --hive-table sample.TIMESHEET -m 1 --driver com.mysql.jdbc.Driver

-------------- workflow.xml ------------

<workflow-app xmlns='uri:oozie:workflow:0.3' name='shell-wf'>

<start to="shellAction"/>

<action name="shellAction">

<shell xmlns="uri:oozie:shell-action:0.1">

<job-tracker>${jobTracker}</job-tracker>

<name-node>${nameNode}</name-node>

<configuration>

<property>

<name>mapred.job.queue.name</name>

<value>${queueName}</value>

</property>

</configuration>

<exec>script.sh</exec>

<file>${ScritpPath}#${ShellScript}</file>

</shell>

<ok to="sendEmail"/>

<error to="killAction"/>

</action>

<action name="sendEmail">

<email xmlns="uri:oozie:email-action:0.1">

<to>${emailToAddress}</to>

<subject>Output of workflow ${wf:id()}</subject>

<body>Results from line count: ${wf:actionData('ShellScript')}</body>

</email>

<ok to="end"/>

<error to="end"/>

</action>

<kill name="killAction">

<message>"Killed job due to error"</message>

</kill>

<end name="end"/>

</workflow-app>

----------------------------------- job.properties --------------

nameNode=hdfs://localhost:8020

jobTracker=localhost:8021

queueName=default

oozie.libpath=${nameNode}/user/oozie/share/lib

oozie.use.system.libpath=true

oozie.wf.rerun.failnodes=true

#appPath=${oozieProjectRoot}/workflowShellAction

#oozie.wf.application.path=${appPath}

ScritpPath=${appPath}//test

ShellScript=script.sh

emailToAddress=abc@bmo.com

To run this command:-

oozie job -oozie http://localhost:11000/oozie -config job.properties -run

Error:-

[root@sandbox test]# Error: E0501 : E0501: Could not perform authorization operation, Call From sandbox.hortonworks.com/10.0.2.15 to localhost.localdomain:8020 failed on connection exception: java.net.ConnectException: Connection refused; For more details see: http://wiki.apache.org/hadoop/ConnectionRefused

3 REPLIES 3
Highlighted

Re: I am getting error in oozie workflow what I have done wrong?

Mentor

do you have the following properties set? Also make sure your /etc/hosts has sandbox entry and in your job properties file refer to sandbox.HORTONWORKS.com rather than local host. Your jobtracker port looks wrong. Where did you get that port? My sample job properties file below.

nameNode=hdfs://sandbox.hortonworks.com:8020
jobTracker=sandbox.hortonworks.com:8050
queueName=default
examplesRoot=oozie
oozie.wf.application.path=${nameNode}/user/${user.name}/${examplesRoot}/apps/shell
  <property>
    <name>hadoop.proxyuser.oozie.hosts</name>
    <value>*</value>
  </property>
  <property>
    <name>hadoop.proxyuser.oozie.groups</name>
    <value>*</value>
  </property>
Highlighted

Re: I am getting error in oozie workflow what I have done wrong?

Thanks for reply.. If its possible can you please create job.properties and workflow.xml files and what location I need to put it for me?

Highlighted

Re: I am getting error in oozie workflow what I have done wrong?

Mentor

@mike pal pick any one of these samples, they were all tested on Sandbox. https://github.com/dbist/oozie