官網(wǎng)
創(chuàng)建第一個工作流
參考官網(wǎng)
- 創(chuàng)建一個名為
flow20.project
. 添加azkaban-flow-version以表明這是一個 Flow 2.0 Azkaban 項目:
azkaban-flow-version: 2.0
注意:可以不叫
flow20
,但是該文件格式必須為.project
格式必須為yaml
格式
- 創(chuàng)建另一個名為
basic.flow
的文件畏陕,添加內(nèi)容如下
nodes:
- name: jobA
type: command
config:
command: echo "This is an echoed text."
注意:可以不叫
basic
凤粗,但是該文件格式必須為.flow
格式必須為yaml
格式
- 將兩個文件(
flow20.project
和basic.flow
)打包成Archive.zip
包(取名隨意)。
Archive.zip
- 登錄
azkaban-web
月趟,創(chuàng)建一個項目
- 上傳
.zip
文件
- 執(zhí)行任務
點擊Execute Flow
點擊Execute
SUCCESS
日志查看
點擊log
查看日志
紅色就是該工作流執(zhí)行任務。echo "This is an echoed text."
歷史執(zhí)行記錄查看
Execution Id
:每執(zhí)一次就會生成一個執(zhí)行結果記錄id
Flow
:工作流名稱
Project
:項目名稱
User
:用戶
Start Time
:執(zhí)行開始時間
End Time
:執(zhí)行結束時間
Elapsed
:
Status
:執(zhí)行狀態(tài):
-- success 成功
-- failure 失敗
-- Runing 運行中
Action
:
多任務工作流
更改basic.flow
文件
nodes:
- name: jobA
type: command
config:
command: echo "This is JOB-A flow "
- name: jobB
type: command
config:
command: echo "This is JOB-B flow "
重新打包(.zip
)恢口,上傳
執(zhí)行
這樣就能執(zhí)行多個任務孝宗。
jobA Log
23-07-2021 17:28:47 CST jobA INFO - Starting job jobA at 1627032527245
23-07-2021 17:28:47 CST jobA INFO - job JVM args: '-Dazkaban.flowid=basic' '-Dazkaban.execid=3' '-Dazkaban.jobid=jobA'
23-07-2021 17:28:47 CST jobA INFO - user.to.proxy property was not set, defaulting to submit user atguigu
23-07-2021 17:28:47 CST jobA INFO - Attached Ramp Props : [{}]
23-07-2021 17:28:47 CST jobA INFO - Building command job executor.
23-07-2021 17:28:47 CST jobA INFO - Failed with 5 inputs with exception e = null
23-07-2021 17:28:47 CST jobA INFO - Memory granted for job jobA
23-07-2021 17:28:47 CST jobA INFO - 1 commands to execute.
23-07-2021 17:28:47 CST jobA INFO - cwd=/opt/module/azkaban-exec/executions/3
23-07-2021 17:28:47 CST jobA INFO - effective user is: atguigu
23-07-2021 17:28:47 CST jobA INFO - Command: echo "This is JOB-A flow "
23-07-2021 17:28:47 CST jobA INFO - Environment variables: {JOB_OUTPUT_PROP_FILE=/opt/module/azkaban-exec/executions/3/jobA_output_1218257985546625341_tmp, JOB_PROP_FILE=/opt/module/azkaban-exec/executions/3/jobA_job_props_552016193113870480_tmp, KRB5CCNAME=/tmp/krb5cc__Demo02__basic__jobA__3__atguigu, JOB_NAME=jobA}
23-07-2021 17:28:47 CST jobA INFO - Working directory: /opt/module/azkaban-exec/executions/3
23-07-2021 17:28:47 CST jobA INFO - Spawned process with id 9717
23-07-2021 17:28:47 CST jobA INFO - This is JOB-A flow
23-07-2021 17:28:47 CST jobA INFO - Process with id 9717 completed successfully in 0 seconds.
23-07-2021 17:28:47 CST jobA INFO - output properties file=/opt/module/azkaban-exec/executions/3/jobA_output_1218257985546625341_tmp
23-07-2021 17:28:47 CST jobA INFO - Finishing job jobA at 1627032527277 with status SUCCEEDED
jobB Log
Job Logs
23-07-2021 17:28:47 CST jobB INFO - Starting job jobB at 1627032527241
23-07-2021 17:28:47 CST jobB INFO - job JVM args: '-Dazkaban.flowid=basic' '-Dazkaban.execid=3' '-Dazkaban.jobid=jobB'
23-07-2021 17:28:47 CST jobB INFO - user.to.proxy property was not set, defaulting to submit user atguigu
23-07-2021 17:28:47 CST jobB INFO - Attached Ramp Props : [{}]
23-07-2021 17:28:47 CST jobB INFO - Building command job executor.
23-07-2021 17:28:47 CST jobB INFO - Failed with 5 inputs with exception e = null
23-07-2021 17:28:47 CST jobB INFO - Memory granted for job jobB
23-07-2021 17:28:47 CST jobB INFO - 1 commands to execute.
23-07-2021 17:28:47 CST jobB INFO - cwd=/opt/module/azkaban-exec/executions/3
23-07-2021 17:28:47 CST jobB INFO - effective user is: atguigu
23-07-2021 17:28:47 CST jobB INFO - Command: echo "This is JOB-B flow "
23-07-2021 17:28:47 CST jobB INFO - Environment variables: {JOB_OUTPUT_PROP_FILE=/opt/module/azkaban-exec/executions/3/jobB_output_6359393867887184859_tmp, JOB_PROP_FILE=/opt/module/azkaban-exec/executions/3/jobB_job_props_2095316725587893623_tmp, KRB5CCNAME=/tmp/krb5cc__Demo02__basic__jobB__3__atguigu, JOB_NAME=jobB}
23-07-2021 17:28:47 CST jobB INFO - Working directory: /opt/module/azkaban-exec/executions/3
23-07-2021 17:28:47 CST jobB INFO - Spawned process with id 9714
23-07-2021 17:28:47 CST jobB INFO - This is JOB-B flow
23-07-2021 17:28:47 CST jobB INFO - Process with id 9714 completed successfully in 0 seconds.
23-07-2021 17:28:47 CST jobB INFO - output properties file=/opt/module/azkaban-exec/executions/3/jobB_output_6359393867887184859_tmp
23-07-2021 17:28:47 CST jobB INFO - Finishing job jobB at 1627032527265 with status SUCCEEDED