去官网https://github.com/azkaban/azkaban/releases 找到对应版本,以Release3.57.0为例,直接使用wget获取对应的包
cd /usr/local/src
wget https://github.com/azkaban/azkaban/archive/refs/tags/3.57.0.tar.gz
接着解压文件
tar -zxvf azkaban-3.57.0.tar.gz
这时会生成对应的azkaban-3.57.0的文件
查看gradle对应的版本
cat /usr/local/src/azkaban-3.57.0/gradle/wrapper/gradle-wrapper.properties
3.57.0对应的是gradle4.6的版本,下载gradle4.6到本地
cd /usr/local/src/azkaban-3.57.0/gradle/wrapper/
wget https://services.gradle.org/distributions/gradle-4.6-all.zip
进入gradle-wrapper.properties文件修改最后一行,不使用远程url
distributionUrl=gradle-4.6-all.zip
返回上面2级目录,开始使用gradlew构建项目下载对应的文件
cd …/…/
./gradlew build installDist -x test
慢慢等待10分钟左右,这个时候会下载相关的文件,下载完成后将这3个压缩包复制到相关目录,我这里安装在/usr/local/azkaban
cp ./azkaban-exec-server/build/distributions/azkaban-exec-server-0.1.0-SNAPSHOT.tar.gz /usr/local/azkaban/
cp ./azkaban-web-server/build/distributions/azkaban-web-server-0.1.0-SNAPSHOT.tar.gz /usr/local/azkaban/
cp ./azkaban-db/build/distributions/azkaban-db-0.1.0-SNAPSHOT.tar.gz /usr/local/azkaban/
解压相关文件并重命名
cd /usr/local/azkaban
tar -zxvf azkaban-exec-server-0.1.0-SNAPSHOT.tar.gz
tar -zxvf azkaban-db-0.1.0-SNAPSHOT.tar.gz
tar -zxvf azkaban-web-server-0.1.0-SNAPSHOT.tar.gz
mv azkaban-web-server-0.1.0-SNAPSHOT azkaban-web-server
mv azkaban-exec-server-0.1.0-SNAPSHOT azkaban-exec-server
mv azkaban-db-0.1.0-SNAPSHOT azkaban-db
进入mysql客户端创建mysql数据库
mysql -uroot -p
创建数据库azkaban
create database azkaban
导入数据库对应的表
use azkaban
source /usr/local/azkaban/azkaban-db/create-all-sql-0.1.0-SNAPSHOT.sql
进入/usr/local/azkaban/azkaban-exec-server/conf,修改azkaban.properties
### 修改时区,
### 并注释如下部分,
### 该部分设置是web-server的个性化配置,exec-server用不到
###
# 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
### 注释如下部分,该部分设置是web-server的用户管理类配置,exec-server用不到
###
# 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
### 注释如下部分,
### 该部分设置是web-server的Jetty服务器属性配置,exec-server用不到
###
# Azkaban Jetty server properties.
#jetty.use.ssl=false
#jetty.maxThreads=25
#jetty.port=8081
### 修改如下为自身地址,端口默认即可
### (该端口应与web-server中配置的jetty.port一致)
###
# Where the Azkaban web server is located
azkaban.webserver.url=http://hadoop-server-002:8081
# 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
### jobtype插件地址
###
# Azkaban plugin settings
azkaban.jobtype.plugin.dir=plugins/jobtypes
### mysql配置,修改如下为自身配置,database要与之前在mysql中建立的数据库名一致
###
# Azkaban mysql settings by default. Users should configure their own username and password.
database.type=mysql
mysql.port=3306
mysql.host=hadoop-server-002
mysql.database=azkaban
mysql.user=root
mysql.password=awifi@123
mysql.numconnections=100
### executor配置
### 添加执行器端口设置executor.port,
### web-server中配置的executor.port应与该端口一致
###
# Azkaban Executor settings
executor.maxThreads=50
executor.flow.threads=30
进入/usr/local/azkaban/azkaban-web-server/conf,修改azkaban.properties
### 修改时区,
### web.resource.dir修改为绝对路径,指向azkaban-web-server下的web/目录
### 其余也可个性化修改
###
# Azkaban Personalization Settings
azkaban.name=Test
azkaban.label=My Local Azkaban
azkaban.color=#FF3601
azkaban.default.servlet.path=/index
web.resource.dir=/usr/local/apps/azkaban/azkaban-web-server/web
default.timezone.id=Asia/Shanghai
### 保持默认,web端用户管理配置,可在azkaban-users.xml中编辑登录用户的信息
###
# 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
### jetty设置
### jetty.port网页端口,应与exec-server中配置的azkaban.webserver.url一致
###
# Azkaban Jetty server properties.
jetty.use.ssl=false
jetty.maxThreads=25
jetty.port=8081
### 执行器端口,应与exec-server中配置的executor.port一致
###
# Azkaban Executor settings
#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
### 修改为与exec-server中配置的mysql属性一致
###
# Azkaban mysql settings by default. Users should configure their own username and password.
database.type=mysql
mysql.port=3306
mysql.host=hadoop-server-002
mysql.database=azkaban
mysql.user=root
mysql.password=awifi@123
mysql.numconnections=100
### 多个Executor时必须配以下参数设置,并且在filters中去掉MinimumFreeMemory,其他默认
### 在每次分发job时,先过滤出满足条件的executor,然后再做比较筛选
### 如最小剩余内存,MinimumFreeMemory,过滤器会检查executor空余内存是否会大于6G,如果不足6G,则web-server不会将任务交由该executor执行。可参考Azkaban Github源码
### 如CpuStatus,过滤器会检查executor的cpu占用率是否达到95%,若达到95%,web-server也不会将任务交给该executor执行。可参考Azkaban Github源码。
### 参数含义参考官网说明
### http://azkaban.github.io/azkaban/docs/latest/#configuration
###
#Multiple Executor
azkaban.use.multiple.executors=true
#azkaban.executorselector.filters=StaticRemainingFlowSize,MinimumFreeMemory,CpuStatus
azkaban.executorselector.filters=StaticRemainingFlowSize,CpuStatus
# 由于是虚拟机,不需要过滤,只需要比较即可
# 某个任务是否指定了executor id
azkaban.executorselector.comparator.NumberOfAssignedFlowComparator=1
# 是否比较内存
azkaban.executorselector.comparator.Memory=1
# 是否最后一次被分发
azkaban.executorselector.comparator.LastDispatched=1
# 是否比较CPU
azkaban.executorselector.comparator.CpuUsage=1
启动exec-server
cd /usr/local/azkaban/azkaban-exec-server/
./bin/start-exec.sh
激活执行器
curl -G “localhost:$(<./executor.port)/executor?action=activate” && echo
不知道执行器的端口的话可以进入mysql库查找executors
select * from executors
里面的port字段就是端口,不用过curl方式执行的话可以直接修改active=1就行
update executors set active=1 where id=1
这样就激活了
继续启动web-server
cd /usr/local/azkaban/azkaban-web-server/
./bin/start-web.sh
然后就登录访问web端:http://127.0.0.1:8081/
默认账号azkaban,azkaban
1.exec-server的日志可以去/usr/local/azkaban/azkaban-exec-server目录下查看executorServerLog__2023-02-09+11:46:13.out,里面有详细信息
2.exec-web的日志可以去/usr/local/azkaban/azkaban-web-server目录下查看webServerLog_2023-02-09+13:37:01.out的日志
3.azkaban3以上版本是通过gradle自己进行build的,下载完相关包之后再copy到自己的安装目录