How to pass Jar files to shell script in OOZIE shell node How to pass Jar files to shell script in OOZIE shell node shell shell

How to pass Jar files to shell script in OOZIE shell node


I would suggest you to somehow shift the dependency out of shell script into java code and run it using the oozie java action node, which will simplify the process to good extend.

Incase if running the Java jar from oozie shell action node is your last option, then we shall very well do that, but it is little bit complicated as for as I know.

Main concerns are,

  • Any Oozie action can not refer contents on local file system of thenode, where it can refer only the contents on HDFS
  • The Java binary command can only refer files on local file system.

So follow the below steps which might help you to co-ordinate what you expect.

  1. Place your Jar file on HDFS
  2. Pass the HDFS absolute path of the Jar as an argument to the shell script.
  3. From the shell script , copy the Jar from HDFS to local on the node , where the action is running, on a fixed location (may be /tmp as you preferred) using copyToLocal cmd.
  4. Invoke the Jar file using the Java command on that node
  5. On completion if any output produced by the Jar file to be conveyed to next action, then copy that output files from local to HDFS from the shell script using copyFromLocal.