Azkaban部署

Azkaban部署

一、集群模式安装

1、上传压缩包,解压等

[root@node01 ~]# tar -zxvf azkaban-db-3.84.4.tar.gz -C /opt/module/azkaban/
[root@node01 ~]# tar -zxvf azkaban-exec-server-3.84.4.tar.gz -C /opt/module/azkaban/
[root@node01 ~]# tar -zxvf azkaban-web-server-3.84.4.tar.gz -C /opt/module/azkaban/

2、配置MySQL

  1. 登陆MySQL,创建Azkaban数据库

    mysql> create database azkaban;
    
  2. 设置密码有效长度6位及以上

    mysql> set global validate_password_length=6;
    
  3. 设置密码策略最低级别

    mysql> set global validate_password_policy=0;
    
  4. 创建Azkaban用户,任何主机都可以访问Azkaban,密码是123456

    mysql> CREATE USER 'azkaban'@'%' IDENTIFIED BY '123456';
    
  5. 赋予Azkaban用户增删改查权限

    mysql> GRANT SELECT,INSERT,UPDATE,DELETE ON azkaban.* to 'azkaban'@'%' WITH GRANT OPTION;
    
  6. 创建Azkaban表,完成后退出MySQL

    mysql> use azkaban;
    mysql> source /opt/module/azkaban/azkaban-db-3.84.4/create-all-sql-3.84.4.sql
    mysql> quit;
    
  7. 更改MySQL包大小;防止Azkaban连接MySQL阻塞

    [root@node01 azkaban]# vim /etc/my.cnf
    # 在[mysqld]下面加一行
    max_allowed_packet=1024M
    
  8. 重启MySQL

    [root@node01 azkaban]# systemctl restart mysqld
    

3、配置Executor Server

  1. 编辑azkaban.properties

    vim /opt/module/azkaban/azkaban-exec-server-3.84.4/conf/azkaban.properties
    
    # Azkaban Personalization Settings
    azkaban.name=Test
    azkaban.label=My Local Azkaban
    azkaban.color=#FF3601
    azkaban.default.servlet.path=/index
    web.resource.dir=web/
    # 将时区改成亚洲
    default.timezone.id=Asia/Shanghai
    # Azkaban UserManager class
    user.manager.class=azkaban.user.XmlUserManager
    user.manager.xml.file=conf/azkaban-users.xml
    # Loader for projects
    executor.global.properties=conf/global.properties
    azkaban.project.dir=projects
    # Velocity dev mode
    velocity.dev.mode=false
    # Azkaban Jetty server properties.
    jetty.use.ssl=false
    jetty.maxThreads=25
    jetty.port=8081
    # Where the Azkaban web server is located
    # 将localhost改成IP
    azkaban.webserver.url=http://192.168.48.10:8081
    # mail settings
    # 配置邮箱的发送人
    mail.sender=abc@qq.com
    mail.host=smtp.qq.com
    mail.user=abc@qq.com
    mail.password=tvmrzsdfefbfg
    # User facing web server configurations used to construct the user facing server URLs. They are useful when there is a reverse proxy between Azkaban web servers and users.
    # enduser -> myazkabanhost:443 -> proxy -> localhost:8081
    # when this parameters set then these parameters are used to generate email links.
    # if these parameters are not set then jetty.hostname, and jetty.port(if ssl configured jetty.ssl.port) are used.
    # azkaban.webserver.external_hostname=myazkabanhost.com
    # azkaban.webserver.external_ssl_port=443
    # azkaban.webserver.external_port=8081
    # 配置邮箱,无论成功与否都发送到这个邮箱
    job.failure.email=abc@qq.com
    job.success.email=abc@qq.com
    lockdown.create.projects=false
    cache.directory=cache
    # JMX stats
    jetty.connector.stats=true
    executor.connector.stats=true
    # Azkaban plugin settings
    azkaban.jobtype.plugin.dir=plugins/jobtypes
    # Azkaban mysql settings by default. Users should configure their own username and password.
    database.type=mysql
    mysql.port=3306
    # 将localhost改成IP
    mysql.host=192.168.48.10
    mysql.database=azkaban
    mysql.user=azkaban
    # 设置密码
    mysql.password=123456
    mysql.numconnections=100
    # Azkaban Executor settings
    executor.maxThreads=50
    executor.flow.threads=30
    # 指定Azkaban Executor的端口号,不然会一直变
    executor.port=12321
    

    注意:上方有许多都是相对路径,等下启动时也要在指定目录下启动。

  2. azkaban-exec-server-3.84.4同步到其他节点

    [root@node01 azkaban]# scp -r azkaban-exec-server-3.84.4/ node02:`pwd`
    [root@node01 azkaban]# scp -r azkaban-exec-server-3.84.4/ node03:`pwd`
    
  3. 必须进入到/opt/module/azkaban/azkaban-exec-server-3.84.4路径,分别在三台机器上,启动executor server

    [root@node01 azkaban-exec-server-3.84.4]# bin/start-exec.sh
    [root@node02 azkaban-exec-server-3.84.4]# bin/start-exec.sh
    [root@node03 azkaban-exec-server-3.84.4]# bin/start-exec.sh
    

    注意:如果在/opt/module/azkaban/azkaban-exec目录下出现executor.port文件,说明启动成功

  4. 激活executor

    [root@node01 azkaban-exec-server-3.84.4]# curl -G "node01:12321/executor?action=activate" && echo
    [root@node01 azkaban-exec-server-3.84.4]# curl -G "node02:12321/executor?action=activate" && echo
    [root@node01 azkaban-exec-server-3.84.4]# curl -G "node03:12321/executor?action=activate" && echo
    

    三台机器都出现{"status":"success"}表示激活成功

4、配置Web Server

  1. 编辑azkaban.properties

    [root@node01 azkaban]# vim /opt/module/azkaban/azkaban-web-server-3.84.4/conf/azkaban.properties
    
    # Azkaban Personalization Settings
    azkaban.name=Test
    azkaban.label=My Local Azkaban
    azkaban.color=#FF3601
    azkaban.default.servlet.path=/index
    web.resource.dir=web/
    # 修改为亚洲时区
    default.timezone.id=Asia/Shanghai
    # Azkaban UserManager class
    user.manager.class=azkaban.user.XmlUserManager
    user.manager.xml.file=conf/azkaban-users.xml
    # Loader for projects
    executor.global.properties=conf/global.properties
    azkaban.project.dir=projects
    # Velocity dev mode
    velocity.dev.mode=false
    # Azkaban Jetty server properties.
    jetty.use.ssl=false
    jetty.maxThreads=25
    jetty.port=8081
    # Azkaban Executor settings
    # mail settings
    mail.sender=
    mail.host=
    # User facing web server configurations used to construct the user facing server URLs. They are useful when there is a reverse proxy between Azkaban web servers and users.
    # enduser -> myazkabanhost:443 -> proxy -> localhost:8081
    # when this parameters set then these parameters are used to generate email links.
    # if these parameters are not set then jetty.hostname, and jetty.port(if ssl configured jetty.ssl.port) are used.
    # azkaban.webserver.external_hostname=myazkabanhost.com
    # azkaban.webserver.external_ssl_port=443
    # azkaban.webserver.external_port=8081
    job.failure.email=
    job.success.email=
    lockdown.create.projects=false
    cache.directory=cache
    # JMX stats
    jetty.connector.stats=true
    executor.connector.stats=true
    # Azkaban mysql settings by default. Users should configure their own username and password.
    database.type=mysql
    mysql.port=3306
    # 将localhost修改为IP
    mysql.host=192.168.48.10
    mysql.database=azkaban
    mysql.user=azkaban
    # 修改成自己配置的密码
    mysql.password=123456
    mysql.numconnections=100
    #Multiple Executor
    azkaban.use.multiple.executors=true
    # 将MinimumFreeMemory去掉,
    azkaban.executorselector.filters=StaticRemainingFlowSize,CpuStatus
    azkaban.executorselector.comparator.NumberOfAssignedFlowComparator=1
    azkaban.executorselector.comparator.Memory=1
    azkaban.executorselector.comparator.LastDispatched=1
    azkaban.executorselector.comparator.CpuUsage=1
    
    1. StaticRemainingFlowSize: 这个过滤器可能会根据流的剩余任务数量来选择 Executor。
    2. MinimumFreeMemory: 这个过滤器可能会根据 Executor 的空闲内存量选择 Executor。测试环境,必须将MinimumFreeMemory删除掉,否则它会认为集群资源不够,不执行。测试环境,必须将MinimumFreeMemory删除掉,否则它会认为集群资源不够,不执行。
    3. CpuStatus: 这个过滤器可能会根据 Executor 的 CPU 使用情况选择 Executor。
  2. 修改azkaban-users.xml文件,配置自己登入的用户

    [root@node01 azkaban]# vim /opt/module/azkaban/azkaban-web-server-3.84.4/conf/azkaban-users.xml
    # 添加一条
    <user password="123456" roles="admin" username="dayu"/>
    
  3. 必须进入到node01/opt/module/azkaban/azkaban-web-server-3.84.4路径,启动web server

    [root@node01 azkaban-web-server-3.84.4]# bin/start-web.sh
    
  4. 访问http://192.168.48.10:8081/,并用自己配的用户登录用户登陆

在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值