编译源码
下载azkaban源码
git clone https://github.com/azkaban/azkaban.git
jdk要求是1.8以上版本
export JAVA_HOME=/home/work/app/presto-admin/package/jdk1.8.0_74
export PATH=$JAVA_HOME/bin:$PATH
编译
# Build Azkaban
./gradlew build
# Clean the build
./gradlew clean
# Build and install distributions
./gradlew installDist
# Run tests
./gradlew test
# Build without running tests
./gradlew build -x tes
安装
安装包路径
ls azkaban/azkaban-solo-server/build/distributions
azkaban-solo-server-3.33.0-25-g3318803.tar.gz
azkaban-solo-server-3.33.0-25-g3318803.zip
解压
tar -zxvf azkaban-solo-server-3.33.0-25-g3318803.tar.gz
采用默认数据库启动
启动的时候要在azkaban的根部下启动
cd azkaban-solo-server-3.33.0-25-g3318803
启动
./bin/azkaban-solo-start.sh &
停止
./bin/azkaban-solo-shutdown.sh
登录控制台
默认端口是8081
用户名:azkban
密码:azkaban
配置mysql数据库
修改conf/azkaban.properties
修改数据库类型,将之前的h2改成mysql
vi conf/azkaban.properties
#database.type=h2#h2.path=./h2#h2.create.tables=true# Velocity dev mode
database.type=mysql
mysql.port=3306
mysql.host=localhost
mysql.database=azkaban
mysql.user=azkaban
mysql.password=123456
mysql.numconnections=100
创建数据库,表以及用户
创建用户以及数据库
CREATE DATABASE azkaban;
CREATE USER 'azkaban'@'%' IDENTIFIED BY '123456';
GRANT ALL ON azkaban.* to 'azkaban'@'localhost' IDENTIFIED BY '123456';
GRANT SELECT,INSERT,UPDATE,DELETE ON azkaban.* to 'azkaban'@'%' WITH GRANT OPTION;
初始化表结构
建表语句在编译后的如下路径:
azkaban/azkaban-db/build/sql/create-all-sql-3.33.0-25-g3318803.sql
mysql> source /home/work/app/azkaban/azkaban-db/build/sql/create-all-sql-3.33.0-25-g3318803.sql;
ERROR 1060 (42S21): Duplicate column name 'resource_id'
Duplicate column name ‘resource_id’这个错误是执行如下语句产生的:
ALTER TABLE project_versions ADD resource_id VARCHAR(512);
但是表resource_id中已经有resource_id这个字段,也是醉醉的
启动
SELECT DISTINCT CONCAT('User: ''',user,'''@''',host,''';') AS query FROM mysql.user;
CREATE DATABASE azkaban DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
grant select,insert,update,delete on azkaban.* to azkaban@'%' identified by 'azkaban';
mysql> source /opt/azkaban/azkaban/azkaban-db/build/sql/create-all-sql-3.52.0-5-g2cc9479.sql 加载所有的表,不然后续azkaban web无法使用。
参考文档:
Installing Azkaban Executor Server后执行
请记住通过调用以下方法激活执行程序:
cd azkaban-exec-server/build/install/azkaban-exec-server
curl -G "localhost:$(<./executor.port)/executor?action=activate" && echo