zoukankan      html  css  js  c++  java
  • Azkaban基础(三):Azkaban 实战(一)

    Azkaban内置的任务类型支持commandjava

    1 单一job案例

    1.案例实操

    1)创建job描述文件

    [atguigu@hadoop102 jobs]$ vim first.job
    #first.job
    type=command
    command=echo 'this is my first job'

    2) job资源文件打包成zip文件

    [atguigu@hadoop102 jobs]$ zip first.zip first.job 
      adding: first.job (deflated 15%)
    [atguigu@hadoop102 jobs]$ ll
    总用量 8
    -rw-rw-r--. 1 atguigu atguigu  60 10月 18 17:42 first.job
    -rw-rw-r--. 1 atguigu atguigu 219 10月 18 17:43 first.zip

    注意:

    目前,Azkaban上传的工作流文件只支持xxx.zip文件。zip应包含xxx.job运行作业所需的文件和任何文件(文件名后缀必须以.job结尾,否则无法识别)。作业名称在项目中必须是唯一的。

    3)通过azkabanweb管理平台创建project并上传jobzip

    首先创建project

    上传zip

    4)启动执行该job

    点击执行工作流

     点击继续

    5Job执行成功

    6)点击查看job日志

    2 邮件通知配置案例

    1)修改配置文件

    修改serverconf下的azkaban.properties文件

    2)在网页上进行配置

     

    3 多job案例

     

    1)创建有依赖关系的多个job描述

    第一个jobstart.job

    [atguigu@hadoop102 jobs]$ vim start.job
    #start.job
    type=command
    command=touch /opt/module/kangkang.txt

    第二个jobstep1.job依赖start.job

    [atguigu@hadoop102 jobs]$ vim step1.job
    #step1.job
    type=command
    dependencies=start
    command=echo "this is step1 job"

    第三个jobstep2.job依赖start.job

    [atguigu@hadoop102 jobs]$ vim step2.job
    #step2.job
    type=command
    dependencies=start
    command=echo "this is step2 job"

    第四个jobfinish.job依赖step1.jobstep2.job

    [atguigu@hadoop102 jobs]$ vim finish.job
    #finish.job
    type=command
    dependencies=step1,step2
    command=echo "this is finish job"

    2)将所有job资源文件打到一个zip包中

    [atguigu@hadoop102 jobs]$ zip jobs.zip start.job step1.job step2.job finish.job
    updating: start.job (deflated 16%)
      adding: step1.job (deflated 12%)
      adding: step2.job (deflated 12%)
      adding: finish.job (deflated 14%) 

    3)在azkabanweb管理界面创建工程并上传zip

    4)启动工作流flow

    6)查看结果

    思考:

    student.txt文件上传到hdfs,根据所传文件创建外部表,再将表中查询到的结果写入到本地文件

    本文来自博客园,作者:秋华,转载请注明原文链接:https://www.cnblogs.com/qiu-hua/p/13947573.html

  • 相关阅读:
    [cf1097F]Alex and a TV Show
    [cf1097E]Egor and an RPG game
    2.2 物理层下面的传输媒体
    2.1 物理层的基本概念
    8 垃圾回收
    7 直接内存
    6 方法区
    1.5 计算机网络体系结构
    1.4 计算机网络的性能指标
    1.3 计算机网络的定义和分类
  • 原文地址:https://www.cnblogs.com/qiu-hua/p/13947573.html
Copyright © 2011-2022 走看看