目錄
1、Azkaban介紹
Azkaban是LinkedIn開源的任務調度框架,類似於JavaEE中的JBPM和Activiti工作流框架。
(1)Azkaban功能和特點:
a、任務的依賴處理。
b、任務監控,失敗告警。
c、任務流的可視化。
d、任務權限管理。
常見的任務調度框架有Apache Oozie、LinkedIn Azkaban、Apache Airflow、Alibaba Zeus,由於Azkaban具有輕量可插拔、友好的WebUI、SLA告警、完善的權限控制、易於二次開發等優點,也得到了廣泛應用。下圖爲Azkaban的架構圖,主要有三部分組成:Azkaban Webserver、Azkaban Executor、 DB。
(2)、各組件功能
a、Webserver主要負責權限驗證、項目管理、作業流下發等工作;
b、Executor主要負責作業流/作業的具體執行以及蒐集執行日誌等工作;
c、MySQL用於存儲作業/作業流的執行狀態信息。圖中所示的是單executor場景,但是實際應用中大部分的項目使用的都是多executor場景。
d、業流執行過程
Azkaban webserver會根據蒐集起來的Executor的狀態選擇一個合適的任務運行節點,並將任務推送給該節點,管理並運行該工作流的所有job。
2、部署模式
Azkaban支持三種部署模式,分別用於學習和測試,高可用部署方式。
(1)solo-server模式
DB使用的是一個內嵌的H2,Web Server和Executor Server運行在同一個進程裏。這種模式包含Azkaban的所有特性,但一般用來學習和測試。
(2)two-server模式
DB使用的是MySQL,MySQL支持master-slave架構,Web Server和Executor Server運行在不同的進程中。
(3)分佈式multiple-executor模式
DB使用的是MySQL,MySQL支持master-slave架構,Web Server和Executor Server運行在不同機器上,且有多個Executor Server。
2、編譯部署
(1)編譯部署
yum install git
yum install gcc-c++
yum install java-1.8.0-openjdk-devel
(2)下載源碼&解壓
mkdir –p /softwares/azkaban/
cd /softwares/azkaban/
wget https://github.com/azkaban/azkaban/archive/3.77.0.tar.gz
mv 3.77.0.tar.gz azkaban-3.77.0.tar.gz
tar -zxvf azkaban-3.77.0.tar.gz
(3)安裝rpm
不安裝可能會報錯
curl --silent --location https://rpm.nodesource.com/setup_5.x | bash -
yum install -y nodejs
(4)編譯
cd cd /softwares/azkaban/
[執行下面命令開始編譯,第一步7-10min,第二步1h+]
./gradlew clean
./gradlew build installDist -x test
2、安裝中遇到的問題
(1)、編譯時報錯
[root@localhost azkaban-3.73.4]# ./gradlew installDist
Parallel execution with configuration on demand is an incubating feature.
Download https://nodejs.org/dist/v8.10.0/node-v8.10.0-linux-x64.tar.gz
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':azkaban-web-server:nodeSetup'.
> Could not resolve all files for configuration ':azkaban-web-server:detachedConfiguration1'.
> Could not download node-linux-x64.tar.gz (org.nodejs:node:8.10.0)
> Could not get resource 'https://nodejs.org/dist/v8.10.0/node-v8.10.0-linux-x64.tar.gz'.
> Read timed out
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or
--debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 1m 28s
解決:安裝rpm
curl --silent --location https://rpm.nodesource.com/setup_5.x | bash -
yum install -y nodejs
參考:
https://azkaban.readthedocs.io/en/latest/getStarted.html#getstartedhead
https://blog.csdn.net/weixin_39445556/article/details/79944117
https://segmentfault.com/a/1190000018508012