Azkaban 编辑的任务文件必须是以job结尾的文件,上传到azkaban的文件必须是zip的压缩包
1、创建job描述文件
[alex@hadoop102 ~]$ cd /opt/module/azkaban
[alex@hadoop102 azkaban]$ mkdir jobs
[alex@hadoop102 azkaban]$ cd jobs/
[alex@hadoop102 jobs]$ vim first.job
#first.job
type=command
command=echo 'this is my first job'
尖叫提示:创建文件必须是job结尾
2、将job资源文件打包成zip文件
[alex@hadoop102 jobs]$ zip first.zip first.job
adding: first.job (deflated 15%)
[alex@hadoop102 jobs]$ ll
总用量 8
-rw-rw-r--. 1 alex alex 60 10月 18 17:42 first.job
-rw-rw-r--. 1 alex alex 219 10月 18 17:43 first.zip
尖叫提示:Azkaban 只识别zip包
注意:
目前,Azkaban上传的工作流文件只支持xxx.zip文件。zip应包含xxx.job运行作业所需的文件和任何文件(文件名后缀必须以.job结尾,否则无法识别)。作业名称在项目中必须是唯一的。
3、首先创建project
通过azkaban的web管理平台,创建project并上传job的zip包
![](https://img-blog.csdnimg.cn/img_convert/43dae23cc81c9561d47cc25c1d6036a3.png)
4、Upload
![](https://img-blog.csdnimg.cn/img_convert/fae6390a47507f4f5df5ff30104e53ae.png)
5、Execute Flow
![](https://img-blog.csdnimg.cn/img_convert/6c0a92d305bc122403e2aec00e9b51c2.png)
6、Schedule 定时执行
![](https://img-blog.csdnimg.cn/img_convert/29f8f8eef75a57f9cc02be08876476fe.png)
设定时间
![](https://img-blog.csdnimg.cn/img_convert/50b378e080195ffad6b9c98dd55f9e6e.png)
7、立即执行
![](https://img-blog.csdnimg.cn/img_convert/3e1decfbce33e4a90c558b0416e5bd27.png)
Continue
![](https://img-blog.csdnimg.cn/img_convert/28e761d8516c06c81d5531d5126a3196.png)
8、Success
![](https://img-blog.csdnimg.cn/img_convert/fa89620ad44c0f3b2c0c329a25be04ea.png)
![](https://img-blog.csdnimg.cn/img_convert/a1932c1455fe66fdb2c73392736c7238.png)
![](https://img-blog.csdnimg.cn/img_convert/423bd5ffedb57b774b62cbdfdfb7ca0b.png)