进入官网https://azkaban.github.io/
点击Downloads跳转到下载页面
选择如下图位置跳转到azkaban的github下载仓库,releases是经过测试完之后的正式版本
我这里下载的是3.76.0版本,下载地址是https://codeload.github.com/azkaban/azkaban/tar.gz/3.76.0,你可以直接点击进行下载,这下载下来的是未经过编译的源码包,需要自己手动编译
当然你也可以直接在这下载,下载编译完成的azkaban压缩包
编译环境需要
mysql 8.0
azkaban 3.75
jdk 1.8
git 2.3
进入解压后的目录,编译
./gradelw distTar
大概45分钟左右,挂上VPN的话会快点
(1)创建azkaban目录
(2)解压azkaban-db的压缩包
tar -zxvf ./azkaban-db/build/distributions/azkaban-db-0.1.0-SNAPSHOT.tar.gz -C /opt/moudle/azkaban
(3)解压azkaban-exec-server的压缩包
tar -zxvf ./azkaban-exec-server/build/distributions/azkaban-exec-server-0.1.0-SNAPSHOT.tar.gz -C /opt/moudle/azkaban
(4)解压azkaban-web-server的压缩包
tar -zxvf ./azkaban-web-server/build/distributions/azkaban-web-server-0.1.0-SNAPSHOT.tar.gz -C /opt/moudle/azkaban
(5)解压azkaban-solo-server的压缩包
tar -zxvf ./azkaban-solo-server/build/distributions/azkaban-solo-server-0.1.0-SNAPSHOT.tar.gz -C /opt/moudle/azkaban
(6)重命名
mv azkaban-db-0.1.0-SNAPSHOT azkaban-db
mv azkaban-exec-server-0.1.0-SNAPSHOT azkaban-exec-server
mv azkaban-web-server-0.1.0-SNAPSHOT azkaban-web-server
mv azkaban-solo-server-0.1.0-SNAPSHOT azkaban-solo-server
(1)创建数据库
create database azkaban;
(2)导入数据
use azkaban;
source /opt/moudle/azkaban/azkaban-db/create-all-sql-0.1.0-SNAPSHOT.sql;
keytool -keystore keystore -alias jetty -genkey -keyalg RSA
此处输入姓名公司的地方可以直接回车
把生成的keystore 放到azkaban-web-server/bin下
# Azkaban Personalization Settings
azkaban.name=Test
azkaban.label=My Local Azkaban
azkaban.color=#FF3601
azkaban.default.servlet.path=/index
web.resource.dir=/disk4/azkaban/azkaban-web-server/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=/disk4/azkaban/azkaban-exec-server/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
azkaban.webserver.url=http://localhost:8081
executor.port=12321
# 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 plugin settings
azkaban.jobtype.plugin.dir=/disk4/azkaban/azkaban-exec-server/plugins/jobtypes
# Azkaban mysql settings by default. Users should configure their own username and password.
database.type=mysql
mysql.port=3306
mysql.host=hadoop102
mysql.database=azkaban
mysql.user=root
mysql.password=admin
mysql.numconnections=100
# Azkaban Executor settings
executor.maxThreads=50
executor.flow.threads=30
use azkaban;
update executors set active=1 where id=1
# Azkaban Personalization Settings
azkaban.name=Test
azkaban.label=My Local Azkaban
azkaban.color=#FF3601
azkaban.default.servlet.path=/index
web.resource.dir=/disk4/azkaban/azkaban-web-server/web
default.timezone.id=Asia/Shanghai
# Azkaban UserManager class
user.manager.class=azkaban.user.XmlUserManager
user.manager.xml.file=/disk4/azkaban/azkaban-web-server/conf/azkaban-users.xml
# Loader for projects
executor.global.properties=/disk4/azkaban/azkaban-exec-server/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.ssl.port=8443
jetty.keystore=/disk4/azkaban/azkaban-web-server/bin/keystore
jetty.password=123456
jetty.keypassword=123456
jetty.truststore=/disk4/azkaban/azkaban-web-server/bin/keystore
jetty.trustpassword=123456
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
mysql.host=hadoop102
mysql.database=azkaban
mysql.user=root
mysql.password=admin
mysql.numconnections=100
#Multiple Executor
azkaban.use.multiple.executors=true
#azkaban.executorselector.filters=StaticRemainingFlowSize,MinimumFreeMemory,CpuStatus
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
添加了一个用户root,密码是admin
<azkaban-users>
<user groups="azkaban" password="azkaban" roles="admin" username="azkaban"/>
<user groups="azkaban" password="admin" roles="admin" username="root"/>
<user password="metrics" roles="metrics" username="metrics"/>
<role name="admin" permissions="ADMIN"/>
<role name="metrics" permissions="METRICS"/>
</azkaban-users>
cd azkaban-exec-server/bin
./start-exec.sh
cd azkaban-web-server/bin
./start-web.sh
jps 查看启动进程
curl http://hadoop102:12321/executor?action=activate
azkaban只支持后缀名为 .job 的文件,并且必须要将该文件打包成zip格式的文件上传,才能识别
在文件中填充内容
type=command
command=echo 'hello azkaban'
type的值只有两种,分别是java和command,java表示执行的是jar包,command表示执行的是命令
如果是java,则下面必须是jar=
如果是command,则下面必须是command=
azkaban有一个坑,那就是
Azkaban 启动任务后一直处于Runnning状态,出现错误如下:
[SystemMemoryInfo] [Azkaban] Free memory amount minus Xmx (2802856 - 0 kb) is less than low mem threshold (3145728 kb), memory request declined.
原因:Azkaban要求必须有3GB的空闲内存才会执行任务
解决方案:
方案1:内存扩容
方案2:取消Azkaban的内存检查
# 如果使用的sol模式
# 在solo/plugins/jobtypes/commonprivate.properties中添加
memCheck.enabled=false
# ===========
# 如果是executor + web Server模式
# 在executor/plugins/jobtypes/commonprivate.properties中添加
memCheck.enabled=false