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
-
登陆MySQL,创建Azkaban数据库
mysql> create database azkaban;
-
设置密码有效长度6位及以上
mysql> set global validate_password_length=6;
-
设置密码策略最低级别
mysql> set global validate_password_policy=0;
-
创建Azkaban用户,任何主机都可以访问Azkaban,密码是123456
mysql> CREATE USER 'azkaban'@'%' IDENTIFIED BY '123456';
-
赋予Azkaban用户增删改查权限
mysql> GRANT SELECT,INSERT,UPDATE,DELETE ON azkaban.* to 'azkaban'@'%' WITH GRANT OPTION;
-
创建Azkaban表,完成后退出MySQL
mysql> use azkaban; mysql> source /opt/module/azkaban/azkaban-db-3.84.4/create-all-sql-3.84.4.sql mysql> quit;
-
更改MySQL包大小;防止Azkaban连接MySQL阻塞
[root@node01 azkaban]# vim /etc/my.cnf # 在[mysqld]下面加一行 max_allowed_packet=1024M
-
重启MySQL
[root@node01 azkaban]# systemctl restart mysqld
3、配置Executor Server
-
编辑
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
注意:上方有许多都是相对路径,等下启动时也要在指定目录下启动。
-
将
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`
-
必须进入到
/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文件,说明启动成功
-
激活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
-
编辑
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
StaticRemainingFlowSize
: 这个过滤器可能会根据流的剩余任务数量来选择 Executor。MinimumFreeMemory
: 这个过滤器可能会根据 Executor 的空闲内存量选择 Executor。测试环境,必须将MinimumFreeMemory删除掉,否则它会认为集群资源不够,不执行。测试环境,必须将MinimumFreeMemory删除掉,否则它会认为集群资源不够,不执行。CpuStatus
: 这个过滤器可能会根据 Executor 的 CPU 使用情况选择 Executor。
-
修改
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"/>
-
必须进入到
node01
的/opt/module/azkaban/azkaban-web-server-3.84.4
路径,启动web server
[root@node01 azkaban-web-server-3.84.4]# bin/start-web.sh
-
访问http://192.168.48.10:8081/,并用自己配的用户登录用户登陆