Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Shell action in oozie is failing

Highlighted

Shell action in oozie is failing

New Contributor

Hi,

We have shell script(psql.sh) which executes psql query(script.sql). It works perfectly fine when i run directly run like `sh psql.sh`. But when i add the same to oozie workflow inside shell-action. It is not recognizing the psql command.

<action name='shell1'> 
	<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>default</value>
			</property>
		</configuration>
		<exec>psql.sh</exec>
		<file>${wf_path}/psql.sh</file>
		<file>${sharedlib}/postgresql-42.2.1.jar</file>
		<file>${wf_path}/script.sql</file>
	</shell>
	<ok to="end" />
	<error to="fail" />
</action>

Please suggest me what i should do here.

My problem is ->i have to run some update queries (will be placed in hdfs path) to postgre db through oozie

1 REPLY 1

Re: Shell action in oozie is failing

Expert Contributor
@Mohan Kumar

Running a psql script using shell action would need the psql command to be available on all the NodeManagers and the user launching the oozie job, needs to be able to launch the psql command across the NM's.

Can you check to see if psql is available across all the NM's?

Also, it would be great if you can also post in the exception that you are seeing from the oozie launcher job for this shell action as shell action would be executed inside the oozie launcher.

Don't have an account?
Coming from Hortonworks? Activate your account here