azkaban是开源的分布式调度框架,但github上并没有提供安装包,需要下载源码编译安装
git地址:https://github.com/azkaban/azkaban (最新的release版本:Release 3.57.0)
官方文档:https://azkaban.readthedocs.io/en/stable/
并且azkaban是以tag形式管理代码的
编译
git clone https://github.com/azkaban/azkaban.git
git tag -l
git checkout -b local/3.57.0 3.57.0
国内用户可以修改maven仓库地址,我用的是阿里云maven仓库,将azkaban目录下的build.gradle中的maven url换成阿里云的 https://plugins.gradle.org/m2/ 换成 http://maven.aliyun.com/nexus/content/groups/public/
./gradlew installDist -x test
如果是阿里云大概1~2分钟就build好了
整理安装文件
azkaban-db/create-all-sql-3.57.0.sql
azkaban-exec-server
azkaban-web-server
安装
- 创建数据库,将sql文件导入数据库
CREATE DATABASE azkaban;
CREATE USER 'username'@'%' IDENTIFIED BY 'password';
GRANT SELECT,INSERT,UPDATE,DELETE ON azkaban.* to '<username>'@'%' WITH GRANT OPTION;
use azkaban;
source azkaban-db/create-all-sql-3.57.0.sql;
- 修改配置,启动azkaban-executor azkaban.properties
#时区
default.timezone.id=Asia/Shanghai
# Where the Azkaban web server is located
azkaban.webserver.url=http://${azkaban.web.ip}:8081
# Azkaban mysql settings by default. Users should configure their own username and password.
database.type=mysql
mysql.port=3306
mysql.host=${mysql.host}
mysql.database=azkaban
mysql.user=${username}
mysql.password=${password}
azkaban executor的启动脚本可以加下如下配置 ,激活executor
#!/bin/bash
script_dir=$(dirname $0)
# pass along command line arguments to the internal launch script.
${script_dir}/internal/internal-start-executor.sh "$@" >executorServerLog__`date +%F+%T`.out 2>&1 &
# wait executor started active the executor
sleep 5s
curl "localhost:$(<./executor.port)/executor?action=activate" && echo
- 修改配置,启动azkaban-web
#时区
default.timezone.id=Asia/Shanghai
# Where the Azkaban web server is located
azkaban.webserver.url=http://${azkaban.web.ip}:8081
database.type=mysql
mysql.port=3306
mysql.host=${mysql.host}
mysql.database=azkaban
mysql.user=${username}
mysql.password=${password}
安装完成,可以通过 ip:8081访问azkaban了。