为了调度HiveSQL任务,安装azkaban任务调度器
azkaban-db-3.84.4.tar.gz
azkaban-exec-server-3.84.4.tar.gz
azkaban-web-server-3.84.4.tar.gz
azkaban下载jar包路径: /opt/install/azkaban/
azkaban安装jar包路径: /opt/soft/azkaban
[root@hurys22 ~]# cd /opt/install/azkaban/
[root@hurys22 azkaban]# ls
azkaban-db-3.84.4.tar.gz azkaban-exec-server-3.84.4.tar.gz azkaban-web-server-3.84.4.tar.gz
创建目录
[root@hurys22 install]# mkdir -p /opt/soft/azkaban
[root@hurys22 install]# ls /opt/soft/azkaban/
[root@hurys22 azkaban]# tar -zxf azkaban-db-3.84.4.tar.gz -C /opt/soft/azkaban/
[root@hurys22 azkaban]# tar -zxf azkaban-exec-server-3.84.4.tar.gz -C /opt/soft/azkaban/
[root@hurys22 azkaban]# tar -zxf azkaban-web-server-3.84.4.tar.gz -C /opt/soft/azkaban/
[root@hurys22 azkaban]# cd /opt/soft/azkaban/
[root@hurys22 azkaban]# ls
azkaban-db-0.1.0-SNAPSHOT azkaban-exec-server-0.1.0-SNAPSHOT azkaban-web-server-0.1.0-SNAPSHOT
[root@hurys22 azkaban]# mv azkaban-db-0.1.0-SNAPSHOT/ azkaban-db
[root@hurys22 azkaban]# mv azkaban-exec-server-0.1.0-SNAPSHOT/ azkaban-exec
[root@hurys22 azkaban]# mv azkaban-web-server-0.1.0-SNAPSHOT/ azkaban-web
[root@hurys22 azkaban]# ls
azkaban-db azkaban-exec azkaban-web
[root@hurys22 azkaban]# cd ./azkaban-exec/lib/
[root@hurys22 lib]# cp /opt/install/mysql-connector-java-8.0.16.jar ./
[root@hurys22 lib]# ll
-rw-r--r-- 1 root root 875336 6月 12 2021 mysql-connector-java-5.1.28.jar (原有驱动包版本)
-rw-r--r-- 1 root root 2293144 7月 25 17:11 mysql-connector-java-8.0.16.jar (新增驱动包版本)
[root@hurys22 azkaban]# mysql -uroot -phurys@123
mysql> create database azkaban;
Query OK, 1 row affected (0.01 sec)
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| azkaban |
创建新用户
设置密码有效长度 4 位及以上
mysql> set global validate_password_length=4;
Query OK, 0 rows affected (0.00 sec)
设置密码策略最低级别
mysql> set global validate_password_policy=0;
Query OK, 0 rows affected (0.00 sec)
创建 Azkaban 用户,任何主机都可以访问 Azkaban,密码是azkaban
mysql> create user 'azkaban'@'%' identified by 'azkaban';
Query OK, 0 rows affected (0.01 sec)
赋予 Azkaban 用户增删改查权限
mysql> grant select,insert,update,delete on azkaban.* to 'azkaban'@'%' with grant option;
Query OK, 0 rows affected (0.00 sec)
mysql> use azkaban;
Database changed
mysql> show tables;
Empty set (0.00 sec)
[root@hurys22 kb15tmp]# cd /opt/soft/azkaban/
[root@hurys22 azkaban]# ls
azkaban-db azkaban-exec azkaban-web
[root@hurys22 azkaban]# cd ./azkaban-db/
[root@hurys22 azkaban-db]# ls
create.active_executing_flows.sql create.project_flows.sql create.triggers.sql
create.active_sla.sql create.project_permissions.sql create.validated_dependencies.sql
create-all-sql-0.1.0-SNAPSHOT.sql
mysql> source /opt/soft/azkaban/azkaban-db/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 |
| ramp |
| ramp_dependency |
| ramp_exceptional_flow_items |
| ramp_exceptional_job_items |
| ramp_items |
| triggers |
| validated_dependencies |
[root@hurys22 azkaban]# vi /etc/my.cnf
在24 [mysqld]下一行添加
25 max_allowed_packet=1024M
[root@hurys22 azkaban]# systemctl restart mysqld
[root@hurys22 azkaban]# systemctl status mysqld
[root@hurys22 azkaban]# cd /opt/soft/azkaban/azkaban-exec/conf/
[root@hurys22 conf]# pwd
/opt/soft/azkaban/azkaban-exec/conf
[root@hurys22 conf]# ls
azkaban.properties global.properties log4j.properties
[root@hurys22 conf]# vi ./azkaban.properties
7 default.timezone.id=Asia/Shanghai
21 azkaban.webserver.url=http://192.168.0.22:8081
44 mysql.host=192.168.0.22
45 mysql.database=azkaban
46 mysql.user=azkaban
47 mysql.password=azkaban
52 executor.port=12321
[root@hurys22 azkaban-exec]# cd ./plugins/jobtypes/
[root@hurys22 jobtypes]# ls
commonprivate.properties
[root@hurys22 jobtypes]# vi ./commonprivate.properties
# set execute-as-user
execute.as.user=false
azkaban.native.lib=false
:wq退出保存后
[root@hurys22 azkaban-exec]# ./bin/start-exec.sh
[root@hurys22 azkaban-exec]# jps
99752 azkabanExecutorServer
[root@hurys22 azkaban-exec]# curl -G "192.168.0.22:12321/executor?action=activate" && echo
窗口出现
{"status":"success"}
mysql> select * from executors; 状态由0变为1
+----+-----------+-------+--------+
| id | host | port | active |
+----+-----------+-------+--------+
| 1 | h2.hadoop | 12321 | 1 |
+----+-----------+-------+--------+
[root@hurys22 azkaban-exec]# cd ../azkaban-web/
[root@hurys22 azkaban-web]# cd ./conf/
[root@hurys22 conf]# vi ./azkaban.properties
7 default.timezone.id=Asia/Shanghai
41 mysql.host=192.168.0.22
42 mysql.database=azkaban
43 mysql.user=azkaban
44 mysql.password=azkaban
48 azkaban.executorselector.filters=StaticRemainingFlowSize,CpuStatus
[root@hurys22 conf]# vi ./azkaban-users.xml
4
[root@hurys22 azkaban-web]# pwd
/opt/soft/azkaban/azkaban-web
[root@hurys22 azkaban-web]# ./bin/start-web.sh
[root@hurys22 azkaban-web]# jps
18712 AzkabanExecutorServer
7194 AzkabanWebServer
7230 Jps
登录 username=jing password=123456
[root@hurys22 azkaban-web]# ./bin/shutdown-web.sh
[root@hurys22 azkaban-exec]# ./bin/shutdown-exec.sh