我在HDFS中有一个Shell脚本。我已经通过以下工作流程在oozie中安排了此脚本。
工作流程:
<workflow-app name="Shell_test" xmlns="uri:oozie:workflow:0.5">
<start to="shell-8f63"/>
<kill name="Kill">
<message>Action failed, error message[${wf:errorMessage(wf:lastErrorNode())}]</message>
</kill>
<action name="shell-8f63">
<shell xmlns="uri:oozie:shell-action:0.1">
<job-tracker>${jobTracker}</job-tracker>
<name-node>${nameNode}</name-node>
<exec>shell.sh</exec>
<argument>${input_file}</argument>
<env-var>HADOOP_USER_NAME=${wf:user()}</env-var>
<file>/user/xxxx/shell_script/lib/shell.sh#shell.sh</file>
<file>/user/xxxx/args/${input_file}#${input_file}</file>
</shell>
<ok to="End"/>
<error to="Kill"/>
</action>
<end name="End"/>
Run Code Online (Sandbox Code Playgroud)
工作性质
nameNode=xxxxxxxxxxxxxxxxxxxx
jobTracker=xxxxxxxxxxxxxxxxxxxxxxxx
queueName=default
oozie.use.system.libpath=true
oozie.wf.application.path=${nameNode}/user/${user.name}/xxxxxxx/xxxxxx
Run Code Online (Sandbox Code Playgroud)
args文件
tableA
tableB
tablec
tableD
Run Code Online (Sandbox Code Playgroud)
现在,shell脚本针对args文件中的单个作业名称运行。如何安排此Shell脚本并行运行。
我希望脚本同时运行10个作业。
这样做需要采取什么步骤。我应该对工作流程进行哪些更改。
我是否应该创建10个工作流来运行10个并行作业。或解决此问题的最佳方案是什么?
我的shell脚本:
#!/bin/bash
[ $# -ne 1 ] && { echo "Usage : $0 table ";exit 1; }
table=$1
job_name=${table}
sqoop job --exec ${job_name}
Run Code Online (Sandbox Code Playgroud)
我的sqoop工作脚本:
sqoop job --create ${table} -- import --connect ${domain}:${port}/${database} …Run Code Online (Sandbox Code Playgroud)