• [Azkaban]-源码编译&部署


    1.准备

      https://downloads.gradle.org/distributions/gradle-4.1-all.zip

      #unzip /home/hadoop/software/azkaban-3.47.0.zip -d /home/hadoop/source/

    2.编译

      首先设置gradle本地,避免编译过程中下载gradle

      #cp ~/software/gradle-4.1-all.zip ~/source/azkaban-3.47.0/gradle/wrapper/

      #vi ~/source/azkaban-3.47.0/gradle/wrapper/gradle-wrapper.properties

      修改配置如下

        distributionUrl=gradle-4.1-all.zip

        #distributionUrl=https://services.gradle.org/distributions/gradle-4.1-all.zip

      编译

      #cd ~/source/azkaban-3.47.0

      #./gradlew build installDist -x test

      编译完成后:

        exec-server安装包: /home/hadoop/source/azkaban-3.47.0/azkaban-exec-server/build/distributions/azkaban-exec-server-0.1.0-SNAPSHOT.tar.gz

        web-server安装包: /home/hadoop/source/azkaban-3.47.0/azkaban-web-server/build/distributions/azkaban-web-server-0.1.0-SNAPSHOT.tar.gz

        solo-server安装包:/home/hadoop/source/azkaban-3.47.0/azkaban-solo-server/build/distributions/azkaban-solo-server-0.1.0-SNAPSHOT.tar.gz

    3.部署

      3.1 部署模式

        Azikaban有三种部署模式

          solo-server模式:内嵌一个H2,Webserver和ExecuteServer在一个进程里面.一般用于学习和测试

          two-server模式,DB使用MySQL,MySQL支持主从架构,Webserver和ExecuteServer运行在不同进程里

          multiple-executor模式(分布式),DB同上,但Webserver和ExcuteServer运行在不同机器上面,且可能有多个ExcuteServer

       这里先使用twn-server模式部署

       先把刚才编译好的安装包拷贝出来:

          # cp ~/source/azkaban-3.47.0/azkaban-exec-server/build/distributions/azkaban-exec-server-0.1.0-SNAPSHOT.tar.gz ~/software/azkaban-exec-server-3.47.0.tar.gz

          # cp ~/source/azkaban-3.47.0/azkaban-web-server/build/distributions/azkaban-web-server-0.1.0-SNAPSHOT.tar.gz ~/software/azkaban-web-server-3.47.0.tar.gz

          # cp ~/source/azkaban-3.47.0/azkaban-solo-server/build/distributions/azkaban-solo-server-0.1.0-SNAPSHOT.tar.gz ~/software/azkaban-solo-server-3.47.0.tar.gz

         解压:

           # tar -xzvf  ~/software/azkaban-web-server-3.47.0.tar.gz -C ~/app/

           # tar -xzvf  ~/software/azkaban-exec-server-3.47.0.tar.gz -C ~/app/

          # tar -xzvf  ~/software/azkaban-solo-server-3.47.0.tar.gz -C ~/app/

       MySQL数据库准备

       切换到root,把Azikaban的建库文件拷贝给mysqladmin用户,并归属给mysqladmin(我的mysqladmin是独立用户)

        #su - root

        #cp /home/hadoop/source/azkaban-3.47.0/azkaban-db/build/sql/create-all-sql-0.1.0-SNAPSHOT.sql /home/mysqladmin

        #chown mysqladmin:dba /home/mysqladmin/create-all-sql-0.1.0-SNAPSHOT.sql

        mysql=>

          create database azkaban;

          use azkaban;

          source /home/mysqladmin/create-all-sql-0.1.0-SNAPSHOT.sql;

        

       创建用户组azkaban并将执行用户加入该组

            # groupadd azkaban

            # sudo usermod -a -G azkaban hadoop

       部署WebServer

         配置文件

           # mkdir ~/app/azkaban-web-server-0.1.0-SNAPSHOT/conf

           # cp ~/app/azkaban-solo-server-0.1.0-SNAPSHOT/conf/azkaban-users.xml ~/app/azkaban-web-server-0.1.0-SNAPSHOT/conf

           # cp ~/app/azkaban-solo-server-0.1.0-SNAPSHOT/conf/azkaban.properties ~/app/azkaban-web-server-0.1.0-SNAPSHOT/conf

           # cp ~/app/azkaban-solo-server-0.1.0-SNAPSHOT/conf/global.properties  ~/app/azkaban-web-server-0.1.0-SNAPSHOT/conf

           # vi ~/app/azkaban-web-server-0.1.0-SNAPSHOT/conf/azkaban.properties

           修改如下:

                                 azkaban.jobtype.plugin.dir=/home/hadoop/app/azkaban-exec-server-0.1.0-SNAPSHOT/plugins/jobtypes

            executor.global.properties=/home/hadoop/app/azkaban-exec-server-0.1.0-SNAPSHOT/conf/global.properties

            default.timezone.id=Asia/Shanghai

            web.resource.dir=/home/hadoop/app/azkaban-web-server-0.1.0-SNAPSHOT/web/

            user.manager.xml.file=/home/hadoop/app/azkaban-web-server-0.1.0-SNAPSHOT/conf/azkaban-users.xml        

            database.type=mysql

            mysql.port=3306

            mysql.host=hadoop000

            mysql.database=azkaban

            mysql.user=root

            mysql.password=12abAB

            mysql.numconnections=100

            #database.type=h2

            #h2.path=./h2

            #h2.create.tables=true

          #vi ~/app/azkaban-web-server-0.1.0-SNAPSHOT/conf/log4j.properties

          编辑如下:

            log4j.rootLogger=INFO,C

            log4j.appender.C=org.apache.log4j.ConsoleAppender

            log4j.appender.C.Target=System.err

            log4j.appender.C.layout=org.apache.log4j.PatternLayout

            log4j.appender.C.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n

         增加用户

         #vi ~/app/azkaban-web-server-0.1.0-SNAPSHOT/conf/azkaban-users.xml

            <user groups="azkaban" password="12abAB" roles="admin" username="hadoop"/>

         启动Web-Server

        

          

         部署ExecuteServer

          拷贝WebServer的配置文件

            # mkdir ~/app/azkaban-exec-server-0.1.0-SNAPSHOT/conf

            # cp ~/app/azkaban-web-server-0.1.0-SNAPSHOT/conf/azkaban.properties ~/app/azkaban-exec-server-0.1.0-SNAPSHOT/conf

            # cp ~/app/azkaban-web-server-0.1.0-SNAPSHOT/conf/log4j.properties ~/app/azkaban-exec-server-0.1.0-SNAPSHOT/conf

            # cp ~/app/azkaban-solo-server-0.1.0-SNAPSHOT/conf/global.properties  ~/app/azkaban-exec-server-0.1.0-SNAPSHOT/conf

          执行插件编译:

            # mkdir -p ~/app/azkaban-exec-server-0.1.0-SNAPSHOT/plugins/jobtypes

                    # cp ~/source/azkaban-3.47.0/az-exec-util/src/main/c/execute-as-user.c  ~/app/azkaban-exec-server-0.1.0-SNAPSHOT/plugins/jobtypes/execute-as-user.c

            # cd ~/app/azkaban-exec-server-0.1.0-SNAPSHOT/plugins/jobtypes

            # gcc execute-as-user.c -o execute-as-user

             整个executeServer文件夹归属交给执行用户

              # chown -R hadoop:azkaban /home/hadoop/app/azkaban-exec-server-0.1.0-SNAPSHOT/

            执行文件提权插件

              # sudo chown root:azkaban execute-as-user

             # sudo chmod 6050 execute-as-user

               # sudo chmod +x ./execute-as-user

          执行插件配置:

            # vi ~/app/azkaban-exec-server-0.1.0-SNAPSHOT/plugins/jobtypes/commonprivate.properties

            编辑如下:

                execute-as-user=false

             azkaban.native.lib=/home/hadoop/app/azkaban-exec-server-0.1.0-SNAPSHOT/plugins/jobtypes/ 

       设置alias方便以后启动

          alias azkaban_start_all="/home/hadoop/app/azkaban-web-server-0.1.0-SNAPSHOT/bin/start-web.sh && /home/hadoop/app/azkaban-exec-server-0.1.0-SNAPSHOT/bin/start-exec.sh"

          alias azkaban_stop_all="/home/hadoop/app/azkaban-web-server-0.1.0-SNAPSHOT/bin/shutdown-web.sh ; /home/hadoop/app/azkaban-exec-server-0.1.0-SNAPSHOT/bin/shutdown-exec.sh"

     3.测试Job

      # mkdir -p ~/shell/azkaban_jobs/hello_job

      #cd ~/shell/azkaban_jobs/hello_job

      # vi ~/shell/azkaban_jobs/hello_job/step_1.job

        type=command

                  command=echo "this is job one"

      # zip -r hello_job.zip ~/shell/azkaban_jobs/hello_job/

        

          执行结果:

        

      

       参考 https://blog.csdn.net/wangpei1949/article/details/79521722

          https://azkaban.github.io/azkaban/docs/latest/#job-types

           

  • 相关阅读:
    在UpdatePanel上使用FileUpload上传文件
    Android配置开发环境
    文件服务器共享目录设置(一)
    win2008R2的Hyperv安装Ubuntu
    Comodo Time Machine导致系统进不去
    sql2005生成sql2000脚本的时候出现“User.UserType: NoLogin 不是SQL Server 2005 的有效选项“ 的解决方案
    迅雷7偷偷上传文件导致机器变卡
    文件服务器共享目录设置(二)
    再谈Javascript原型继承
    a和a:link的区别
  • 原文地址:https://www.cnblogs.com/NightPxy/p/9204814.html
Copyright © 2020-2023  润新知