title: How to execute parallel jobs in oozie
body: <p>I have a shell script in HDFS. I have scheduled this script in oozie with the following workflow.</p>
  
  <p>Workflow:</p>
  
  <pre><code>&lt;workflow-app name="Shell_test" xmlns="uri:oozie:workflow:0.5"&gt;
  &lt;start to="shell-8f63"/&gt;
  &lt;kill name="Kill"&gt;
      &lt;message&gt;Action failed, error message[${wf:errorMessage(wf:lastErrorNode())}]&lt;/message&gt;
  &lt;/kill&gt;
  &lt;action name="shell-8f63"&gt;
      &lt;shell xmlns="uri:oozie:shell-action:0.1"&gt;
          &lt;job-tracker&gt;${jobTracker}&lt;/job-tracker&gt;
          &lt;name-node&gt;${nameNode}&lt;/name-node&gt;
          &lt;exec&gt;shell.sh&lt;/exec&gt;
          &lt;argument&gt;${input_file}&lt;/argument&gt;
          &lt;env-var&gt;HADOOP_USER_NAME=${wf:user()}&lt;/env-var&gt;
          &lt;file&gt;/user/xxxx/shell_script/lib/shell.sh#shell.sh&lt;/file&gt;
          &lt;file&gt;/user/xxxx/args/${input_file}#${input_file}&lt;/file&gt;
      &lt;/shell&gt;
      &lt;ok to="End"/&gt;
      &lt;error to="Kill"/&gt;
  &lt;/action&gt;
  &lt;end name="End"/&gt;
  </code></pre>
  
  <p></p>
  
  <p>job properties</p>
  
  <pre><code>nameNode=xxxxxxxxxxxxxxxxxxxx
  jobTracker=xxxxxxxxxxxxxxxxxxxxxxxx
  queueName=default
  oozie.use.system.libpath=true
  oozie.wf.application.path=${nameNode}/user/${user.name}/xxxxxxx/xxxxxx 
  </code></pre>
  
  <p>args file</p>
  
  <pre><code>tableA
  tableB
  tablec
  tableD
  </code></pre>
  
  <p>Now the shell script runs for single job name in args file. How can I schedule this  shell script to run in parallel.</p>
  
  <p>I want the script to run for 10 jobs at the same time.</p>
  
  <p>What are the steps needed to do so. What changes should I make to the workflow.</p>
  
  <p>Should I create 10 workflows for running 10 parallel jobs. Or what are the best scenarios to deal with this issue.</p>
  
  <p>My shell script:</p>
  
  <pre><code>#!/bin/bash
  
  [ $# -ne 1 ] &amp;&amp; { echo "Usage : $0 table ";exit 1; }
  
  table=$1
  
  job_name=${table}
  
  sqoop job  --exec ${job_name}
  </code></pre>
  
  <p>My sqoop job script:</p>
  
  <pre><code>sqoop job --create ${table} -- import --connect ${domain}:${port}/${database} --username ${username} --password ${password} --query "SELECT * from ${database}.${table} WHERE \$CONDITIONS" -m 1 --hive-import --hive-database ${hivedatabase} --hive-table ${table} --as-parquetfile --incremental append --check-column id --last-value "${last_val}"  --target-dir /user/xxxxx/hive/${hivedatabase}.db/${table} --outdir /home/$USER/logs/outdir
  </code></pre>