一百三十六、Azkaban——Azkaban3.84.4单机版安装

一、目的

为了调度HiveSQL任务,安装azkaban任务调度器

二、jar包准备

azkaban-db-3.84.4.tar.gz

azkaban-exec-server-3.84.4.tar.gz

azkaban-web-server-3.84.4.tar.gz

三、安装步骤

(一)jar包路径和安装路径

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

(四)注意azkaban-exec的lib目录下MySQL驱动包版本匹配问题(如果MySQL版本高,那么需要更换azkaban-exec的MySQL驱动包)


[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  (新增驱动包版本)


(五)需要MySQL支持,登录MySQL   首先在root用户的MySQL中创建数据库azkaban,后面azkaban用户的MySQL中会自动生成azkaban数据库


[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)

(六)查看azkaban-db里的create-all-sql-0.1.0-SNAPSHOT.sql

[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

(七)在root用户的MySQL的azkaban数据库里运行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      |

(八)退出后修改配置文件:更改 MySQL 包大小,防止 Azkaban 连接 MySQL 阻塞


[root@hurys22 azkaban]# vi /etc/my.cnf

在24 [mysqld]下一行添加
25    max_allowed_packet=1024M

(九):wq退出保存后,重启MySQL服务

[root@hurys22 azkaban]# systemctl restart mysqld
[root@hurys22 azkaban]# systemctl status mysqld

(十)修改azkaban-exec配置文件azkaban.properties 

[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


 (十一)修改 azkaban-exec配置文件commonprivate.properties 


[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退出保存后

(十二)查看并启动azkaban-exec 服务        


[root@hurys22 azkaban-exec]# ./bin/start-exec.sh 
[root@hurys22 azkaban-exec]# jps
99752 azkabanExecutorServer

(十二)激活executor


[root@hurys22 azkaban-exec]# curl -G "192.168.0.22:12321/executor?action=activate" && echo

窗口出现
{"status":"success"}

(十三)登录azkaban用户的MySQL,进入azkaban数据库


mysql> select * from executors;    状态由0变为1 
+----+-----------+-------+--------+
| id | host      | port  | active |
+----+-----------+-------+--------+
|  1 | h2.hadoop | 12321 |      1 |
+----+-----------+-------+--------+


(十四)修改azkaban-web配置文件azkaban.properties


[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

(十五)修改azkaban-web配置文件azkaban-users.xml 创建用户和密码

[root@hurys22 conf]# vi ./azkaban-users.xml
4  

(十六)启动azkaban-web服务


[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


(十七)打开页面 http://192.168.0.22:8081/

登录    username=jing  password=123456

一百三十六、Azkaban——Azkaban3.84.4单机版安装_第1张图片

 

(十八)关闭azkaban-web服务


[root@hurys22 azkaban-web]# ./bin/shutdown-web.sh

(十九)关闭azkaban-exec服务


[root@hurys22 azkaban-exec]# ./bin/shutdown-exec.sh 

你可能感兴趣的:(大数据调度工具,azkaban)