我相信,很多人看到源码编译安装,都想离开,但是说句心里话,这个azkaban的源码编译安装还是比较简单的。下面我提供一下我执行的脚本,按照操作即可。
将从官网下载的源码包解压,然后依次执行如下命令:
./gradlew clean
# Build and install distributions
./gradlew installDist
# Run tests
./gradlew test
# Build without running tests
./gradlew build -x test
[root@server4 azkaban-master]# ./gradlew build
···
> Task :azkaban-web-server:compileTestJava
Note: /usr/local/azkaban-master/azkaban-web-server/src/test/java/azkaban/webapp/AzkabanWebServes or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: /usr/local/azkaban-master/azkaban-web-server/src/test/java/azkaban/scheduler/QuartzJobDejava uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
BUILD SUCCESSFUL in 5m 56s
96 actionable tasks: 80 executed, 16 up-to-date
[root@server4 azkaban-master]# ./gradlew clean
Parallel execution with configuration on demand is an incubating feature.
BUILD SUCCESSFUL in 2s
18 actionable tasks: 18 executed
[root@server4 azkaban-master]# ./gradlew installDist
Parallel execution with configuration on demand is an incubating feature.
> Task :azkaban-web-server:npm_install
added 39 packages in 1.106s
BUILD SUCCESSFUL in 13s
50 actionable tasks: 36 executed, 13 from cache, 1 up-to-date
[root@server4 azkaban-master]# ./gradlew test
Parallel execution with configuration on demand is an incubating feature.
> Task :azkaban-web-server:npm_install
added 39 packages in 0.871s
> Task :azkaban-web-server:jsTest
addClass
? should add class into element
? should not add a class which already exists in element
CronTransformation
? should transfer correctly
ValidateQuartzStr
? validate Quartz String corretly
momentJSTest
? momentJSTest
? momentTimezoneTest
6 passing (12ms)
BUILD SUCCESSFUL in 1m 50s
62 actionable tasks: 22 executed, 11 from cache, 29 up-to-date
[root@server4 azkaban-master]# ./gradlew distTar
Parallel execution with configuration on demand is an incubating feature.
> Task :azkaban-web-server:npm_install
added 39 packages in 0.944s
BUILD SUCCESSFUL in 12s
51 actionable tasks: 37 executed, 13 from cache, 1 up-to-date
bulid成功之后,分别进入如下目录:
/usr/local/azkaban-master/azkaban-db/build/distributions
/usr/local/azkaban-master/azkaban-exec-server/build/distributions
/usr/local/azkaban-master/azkaban-web-server/build/distributions
然后拷贝出其中的tar包,这个tar包就是我们以后需要用到的安装包。[可以留用备份]
[root@server4 distributions]# sz azkaban-web-server-0.1.0-SNAPSHOT.tar.gz
得到azkaban的安装包之后,我们就可以开始安装了。
azkaban的工作模式分成executor,web,mysql数据库。其中executor是用于执行azkaban job(即我们上传的job);而web是用于方便交互操作的web界面;mysql数据库是azkaban用于存储job,运行过程/结果等信息。mysql不必安装在azkaban安装的机器上。它们机器之间只要能够访问即可。
创建一个azkaban数据库。
mysql> create database azkaban character set utf8;
Query OK, 1 row affected (0.02 sec)
创建azkaban用户
mysql> create user 'azkaban'@'%' identified by '123456';
Query OK, 0 rows affected (0.00 sec)
授予权限
mysql> grant all privileges on azkaban.* to azkaban;
Query OK, 0 rows affected (0.01 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
tar -zxvf azkaban-web-server-0.1.0-SNAPSHOT.tar.gz
tar -zxvf azkaban-exec-server-0.1.0-SNAPSHOT.tar.gz
tar -zxvf azkaban-db-0.1.0-SNAPSHOT.tar.gz
导入azkaban使用表
[root@server4 azkaban-db-0.1.0-SNAPSHOT]# mysql -uazkaban -p123456
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 6
Server version: 5.7.22-log MySQL Community Server (GPL)
Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> use azkaban ;
Database changed
mysql> source create-all-sql-0.1.0-SNAPSHOT.sql
···
mysql> show tables;
+--------------------------+
| Tables_in_azkaban |
+--------------------------+
| QRTZ_BLOB_TRIGGERS |
| QRTZ_CALENDARS |
| QRTZ_CRON_TRIGGERS |
| QRTZ_FIRED_TRIGGERS |
| QRTZ_JOB_DETAILS |
| QRTZ_LOCKS |
| QRTZ_PAUSED_TRIGGER_GRPS |
| QRTZ_SCHEDULER_STATE |
| QRTZ_SIMPLE_TRIGGERS |
| QRTZ_SIMPROP_TRIGGERS |
| QRTZ_TRIGGERS |
| active_executing_flows |
| active_sla |
| execution_dependencies |
| execution_flows |
| execution_jobs |
| execution_logs |
| executor_events |
| executors |
| project_events |
| project_files |
| project_flow_files |
| project_flows |
| project_permissions |
| project_properties |
| project_versions |
| projects |
| properties |
| triggers |
+--------------------------+
29 rows in set (0.00 sec)
往表executors
中插入数据
insert into executors(1,'localhost',3306,1);
web
[root@server4 bin]# ll
total 264
drwxr-xr-x. 2 root root 50 Oct 31 17:41 internal
drwxr-xr-x. 2 root root 35 Oct 31 17:50 logs
-rwxr-xr-x. 1 root root 211 Jul 27 04:25 shutdown-web.sh
-rwxr-xr-x. 1 root root 123 Jul 27 04:25 start-web.sh
drwxr-xr-x. 2 root root 6 Oct 31 18:03 temp
-rw-r--r--. 1 root root 217241 Oct 31 18:00 webServerLog_2018-10-31+17:50:44.out
-rw-r--r--. 1 root root 28509 Oct 31 18:03 webServerLog_2018-10-31+18:03:07.out
-rw-r--r--. 1 root root 8459 Oct 31 18:33 webServerLog_2018-10-31+18:33:05.out
[root@server4 bin]# pwd
/usr/local/azkaban-web-server-0.1.0-SNAPSHOT/bin
excutor
[root@server4 azkaban-exec-server-0.1.0-SNAPSHOT]# ll
total 20
drwxr-xr-x. 7 root root 175 Oct 31 18:30 bin
drwxr-xr-x. 2 root root 81 Oct 31 18:32 conf
-rw-r--r--. 1 root root 6 Oct 31 18:32 currentpid
drwxr-sr-x. 2 root root 6 Oct 31 18:32 executions
-rw-r--r--. 1 root root 5 Oct 31 18:32 executor.port
-rw-r--r--. 1 root root 7881 Oct 31 18:36 executorServerLog__2018-10-31+18:32:35.out
drwxr-xr-x. 2 root root 4096 Jul 27 21:33 lib
drwxr-xr-x. 2 root root 36 Oct 31 18:32 logs
drwxr-xr-x. 3 root root 22 Jul 27 21:33 plugins
drwxr-xr-x. 2 root root 6 Oct 31 18:32 projects
drwxr-xr-x. 2 root root 6 Oct 31 18:32 temp
[root@server4 azkaban-exec-server-0.1.0-SNAPSHOT]# cd bin
[root@server4 bin]# ll
total 20
drwxr-sr-x. 2 root root 6 Oct 31 18:30 executions
-rw-r--r--. 1 root root 9754 Oct 31 18:30 executorServerLog__2018-10-31+18:30:57.out
drwxr-xr-x. 2 root root 55 Oct 31 17:40 internal
drwxr-xr-x. 2 root root 36 Oct 31 18:30 logs
drwxr-xr-x. 2 root root 6 Oct 31 18:30 projects
-rwxr-xr-x. 1 root root 214 Jul 27 04:25 shutdown-exec.sh
-rwxr-xr-x. 1 root root 207 Jul 27 04:25 start-exec.sh
drwxr-xr-x. 2 root root 6 Oct 31 18:30 temp
如果有启动问题,需要从输出日志中查看问题。
在浏览器中打开http://192.168.211.4:8081/
发现界面如下:
怎么这么丑?!!
肯定是样式文件没有加载成功,导致出现是对的但是巨丑的页面。
修改web中的azkaban.properties文件,将如下内容
web.resource.dir=web/
修改成绝对路径web.resource.dir=/usr/local/azkaban-web-server-0.1.0-SNAPSHOT/web
重启web。
使用默认的用户azkaban,密码azkaban登录,得到界面如下:
到此,azkaban安装过程结束。