我尝试使用Oozie调度程序使用sqoop,但Oozie立即杀死了这个工作。 Sqoop命令通过终端正常工作。
sqoop import \
--connect "jdbc:xxxxxxxx" \
--username=xxxxxxxx \
--password=xxxxxxxx \
--driver ctree.jdbc.ctreeDriver \
--table odhfgdb \
--target-dir "/acting/user/odhfgdb-tmp" \
--fields-terminated-by '\001' \
--escaped-by \\ \
--delete-target-dir \
--split-by entry_date \
--where="entry_date < CURRENT_DATE" --m 30
你能告诉我,在Oozie中我需要做什么才能使这个命令起作用?
以下是日志:
2016-06-27 19:27:51,492 INFO ActionStartXCommand:543 - SERVER[servername] USER[admin] GROUP[-] TOKEN[] APP[My_Workflow] JOB[0000010-160627000427464-oozie-oozi-W] ACTION[0000010-160627000427464-oozie-oozi-W@:start:] Start action [0000010-160627000427464-oozie-oozi-W@:start:] with user-retry state : userRetryCount [0], userRetryMax [0], userRetryInterval [10]
2016-06-27 19:27:51,493 INFO ActionStartXCommand:543 - SERVER[servername] USER[admin] GROUP[-] TOKEN[] APP[My_Workflow] JOB[0000010-160627000427464-oozie-oozi-W] ACTION[0000010-160627000427464-oozie-oozi-W@:start:] [***0000010-160627000427464-oozie-oozi-W@:start:***]Action status=DONE
2016-06-27 19:27:51,494 INFO ActionStartXCommand:543 - SERVER[servername] USER[admin] GROUP[-] TOKEN[] APP[My_Workflow] JOB[0000010-160627000427464-oozie-oozi-W] ACTION[0000010-160627000427464-oozie-oozi-W@:start:] [***0000010-160627000427464-oozie-oozi-W@:start:***]Action updated in DB!
2016-06-27 19:27:52,310 INFO ActionStartXCommand:543 - SERVER[servername] USER[admin] GROUP[-] TOKEN[] APP[My_Workflow] JOB[0000010-160627000427464-oozie-oozi-W] ACTION[0000010-160627000427464-oozie-oozi-W@sqoop-283e] Start action [0000010-160627000427464-oozie-oozi-W@sqoop-283e] with user-retry state : userRetryCount [0], userRetryMax [0], userRetryInterval [10]
2016-06-27 19:27:56,418 INFO SqoopActionExecutor:543 - SERVER[servername] USER[admin] GROUP[-] TOKEN[] APP[My_Workflow] JOB[0000010-160627000427464-oozie-oozi-W] ACTION[0000010-160627000427464-oozie-oozi-W@sqoop-283e] checking action, hadoop job ID [job_1466989378023_0024] status [RUNNING]
2016-06-27 19:27:56,420 INFO ActionStartXCommand:543 - SERVER[servername] USER[admin] GROUP[-] TOKEN[] APP[My_Workflow] JOB[0000010-160627000427464-oozie-oozi-W] ACTION[0000010-160627000427464-oozie-oozi-W@sqoop-283e] [***0000010-160627000427464-oozie-oozi-W@sqoop-283e***]Action status=RUNNING
2016-06-27 19:27:56,421 INFO ActionStartXCommand:543 - SERVER[servername] USER[admin] GROUP[-] TOKEN[] APP[My_Workflow] JOB[0000010-160627000427464-oozie-oozi-W] ACTION[0000010-160627000427464-oozie-oozi-W@sqoop-283e] [***0000010-160627000427464-oozie-oozi-W@sqoop-283e***]Action updated in DB!
2016-06-27 19:28:14,293 INFO CallbackServlet:543 - SERVER[servername] USER[-] GROUP[-] TOKEN[-] APP[-] JOB[0000010-160627000427464-oozie-oozi-W] ACTION[0000010-160627000427464-oozie-oozi-W@sqoop-283e] callback for action [0000010-160627000427464-oozie-oozi-W@sqoop-283e]
2016-06-27 19:28:15,752 INFO SqoopActionExecutor:543 - SERVER[servername] USER[admin] GROUP[-] TOKEN[] APP[My_Workflow] JOB[0000010-160627000427464-oozie-oozi-W] ACTION[0000010-160627000427464-oozie-oozi-W@sqoop-283e] action completed, external ID [job_1466989378023_0024]
2016-06-27 19:28:15,764 WARN SqoopActionExecutor:546 - SERVER[servername] USER[admin] GROUP[-] TOKEN[] APP[My_Workflow] JOB[0000010-160627000427464-oozie-oozi-W] ACTION[0000010-160627000427464-oozie-oozi-W@sqoop-283e] Launcher ERROR, reason: Main class [org.apache.oozie.action.hadoop.SqoopMain], exit code [1]
2016-06-27 19:28:16,137 INFO ActionEndXCommand:543 - SERVER[servername] USER[admin] GROUP[-] TOKEN[] APP[My_Workflow] JOB[0000010-160627000427464-oozie-oozi-W] ACTION[0000010-160627000427464-oozie-oozi-W@sqoop-283e] ERROR is considered as FAILED for SLA
2016-06-27 19:28:16,257 INFO ActionStartXCommand:543 - SERVER[servername] USER[admin] GROUP[-] TOKEN[] APP[My_Workflow] JOB[0000010-160627000427464-oozie-oozi-W] ACTION[0000010-160627000427464-oozie-oozi-W@Kill] Start action [0000010-160627000427464-oozie-oozi-W@Kill] with user-retry state : userRetryCount [0], userRetryMax [0], userRetryInterval [10]
2016-06-27 19:28:16,258 INFO ActionStartXCommand:543 - SERVER[servername] USER[admin] GROUP[-] TOKEN[] APP[My_Workflow] JOB[0000010-160627000427464-oozie-oozi-W] ACTION[0000010-160627000427464-oozie-oozi-W@Kill] [***0000010-160627000427464-oozie-oozi-W@Kill***]Action status=DONE
2016-06-27 19:28:16,259 INFO ActionStartXCommand:543 - SERVER[servername] USER[admin] GROUP[-] TOKEN[] APP[My_Workflow] JOB[0000010-160627000427464-oozie-oozi-W] ACTION[0000010-160627000427464-oozie-oozi-W@Kill] [***0000010-160627000427464-oozie-oozi-W@Kill***]Action updated in DB!
以下是在HUE中生成的工作流程:
<workflow-app name="My_Workflow" xmlns="uri:oozie:workflow:0.5">
<start to="sqoop-283e"/>
<kill name="Kill">
<message>Action failed, error message[${wf:errorMessage(wf:lastErrorNode())}]</message>
</kill>
<action name="sqoop-283e">
<sqoop xmlns="uri:oozie:sqoop-action:0.2">
<job-tracker>${jobTracker}</job-tracker>
<name-node>${nameNode}</name-node>
<command>import --connect jdbc:xxxxxxx --username=xxxxxx --password=xxxxxxx --driver ctree.jdbc.ctreeDriver --table odhfgdb --target-dir /acting/user/odhfgdb-tmp --fields-terminated-by \001 --escaped-by \\ --delete-target-dir --split-by entry_date --where=entry_date < CURRENT_DATE --m 30</command>
</sqoop>
<ok to="End"/>
<error to="Kill"/>
</action>
<end name="End"/>
</workflow-app>