獲取編譯好的文件
獲取編譯好的安裝文件上傳并解壓/root/hd/azkaban-3.50.0
找到三個需要的配置文件
azkaban-db/build/distributions
azkaban-web-server/build/distributions
azkaban-exec-server/build/distributions
distributions下就是我們需要的編譯后的壓縮文件
把壓縮文件分別分發(fā)到對應(yīng)的服務(wù)器
在azkaban-db/build/distributions下 只需獲取create-all-sql-0.1.0-SNAPSHOT.sql 創(chuàng)建數(shù)據(jù)庫表
分布式multiple-executor模式安裝部署
任務(wù)分配如下
HOST 角色
node1 web-server
node2 mysql
node3 exec-server
node4 exec-server
mysql
create database azkaban_data;
grant all privileges on azkaban_data.* to 'hive'@'%' identified by 'hive';
grant all privileges on azkaban_data.* to 'hive'@'localhost' identified by 'hive';
grant all privileges on azkaban_data.* to 'hive'@'hq555' identified by 'hive';
flush privileges;
source /root/hd/create-all-sql-0.1.0-SNAPSHOT.sql ;
注意 如果導(dǎo)入數(shù)據(jù)過程報錯 索引過長 更改數(shù)據(jù)庫編碼 刪除所有表 重新導(dǎo)入數(shù)據(jù)
拷貝web-server到node1
解壓
生成ssl
keytool -keystore keystore -alias jetty -genkey -keyalg RSA
注:密碼和最后確認(rèn)需要輸入,其他默認(rèn)即可口蝠。生成keystore復(fù)制到exe所在服務(wù)器為配置準(zhǔn)備
設(shè)置web‐server
拷貝conf目錄和log4j.properties
scp -r /root/azkaban-solo-server-0.1.0-SNAPSHOT/conf /root/azkaban-web-server-0.1.0-SNAPSHOT/
scp azkaban-3.42.0/azkaban-web-server/src/test/resources/log4j.properties azkaban-web-server-0.1.0-SNAPSHOT/conf/
vim azkaban-web-server-0.1.0-SNAPSHOT/conf/azkaban.properties
// 配置內(nèi)容如下
azkaban.name=Test
azkaban.label=My Local Azkaban
azkaban.color=#FF3601
azkaban.default.servlet.path=/index
web.resource.dir=/root/hd/azkaban/azkaban-web-server-0.1.0-SNAPSHOT/web
default.timezone.id=Asia/Shanghai // 時間修改為上海
# Azkaban UserManager class
user.manager.class=azkaban.user.XmlUserManager
user.manager.xml.file=/root/hd/azkaban/azkaban-web-server-0.1.0-SNAPSHOT/conf/azkaban-users.xml
# Loader for projects
executor.global.properties=/root/hd/azkaban/azkaban-web-server-0.1.0-SNAPSHOT/conf/global.properties
azkaban.project.dir=projects
#database.type=h2
#h2.path=./h2
#h2.create.tables=true
database.type=mysql
mysql.port=3306
mysql.host=hq666
mysql.database=azkaban_data
mysql.user=hive
mysql.password=hive
mysql.numconnections=100
# Velocity dev mode
velocity.dev.mode=false
# Azkaban Jetty server properties.
#jetty.use.ssl=true
jetty.maxThreads=25
jetty.port=8081
jetty.keystore=/root/hd/keystore
jetty.password=****
jetty.keypassword=****
jetty.truststore=/root/hd/keystore
jetty.trustpassword=****
# Azkaban Executor settings
executor.port=12321
# mail settings
mail.sender=
mail.host=
# User facing web server configurations used to construct the user facing server URLs. They are useful when there is a reverse proxy between Azkaban web servers and users.
# enduser -> myazkabanhost:443 -> proxy -> localhost:8081
# when this parameters set then these parameters are used to generate email links.
# if these parameters are not set then jetty.hostname, and jetty.port(if ssl configured jetty.ssl.port) are used.
# azkaban.webserver.external_hostname=myazkabanhost.com
# azkaban.webserver.external_ssl_port=443
# azkaban.webserver.external_port=8081
job.failure.email=
job.success.email=
lockdown.create.projects=false
cache.directory=cache
# JMX stats
jetty.connector.stats=true
executor.connector.stats=true
# Azkaban plugin settings
azkaban.jobtype.plugin.dir=/root/hd/azkaban/azkaban-web-server-0.1.0-SNAPSHOT/plugins/jobtypes
#啟用multiple-executor模式
azkaban.use.multiple.executors=true
#在每次分發(fā)job時狂打,先過濾出滿足條件的executor,然后再做比較篩選
#如最小剩余內(nèi)存,MinimumFreeMemory,過濾器會檢查executor空余內(nèi)存是否會大于6G真友,如果不足6G敞葛,則web-server不會將任務(wù)交由該executor執(zhí)行。可參考Azkaban Github源碼
#如CpuStatus毒租,過濾器會檢查executor的cpu占用率是否達(dá)到95%,若達(dá)到95%箱叁,web-server也不會將任務(wù)交給該executor執(zhí)行墅垮。可參考Azkaban Github源碼耕漱。
#參數(shù)含義參考官網(wǎng)說明 http://azkaban.github.io/azkaban/docs/latest/#configuration
#由于是虛擬機(jī)算色,不需要過濾,只需要比較即可
#azkaban.executorselector.filters=StaticRemainingFlowSize,MinimumFreeMemory,CpuStatus
#某個任務(wù)是否指定了executor id
azkaban.executorselector.comparator.NumberOfAssignedFlowComparator=1
#內(nèi)存
azkaban.executorselector.comparator.Memory=1
#最后一次被分發(fā)
azkaban.executorselector.comparator.LastDispatched=1
#CPU
azkaban.executorselector.comparator.CpuUsage=1
注意涉及到路徑都寫絕對路徑
設(shè)置plugins/jobtypes
mkdir -p plugins/jobtypes
vim commonprivate.properties
azkaban.native.lib=false
execute.as.user=false
添加用戶azkaban-users.xml
<user username="admin" password="admin" roles="admin,metrics"/>
<user groups="azkaban" password="azkaban" roles="admin" username="azkaban"/>
<user password="metrics" roles="metrics" username="metrics"/>
<role name="admin" permissions="ADMIN"/>
<role name="metrics" permissions="METRICS"/>
拷貝exec-server到node3螟够、node4
解壓
從web-server拷貝conf目錄灾梦、plugins目錄到executor‐server下
注意conf/azkaban.properties配置的路徑需要改 如下
# Azkaban Personalization Settings
azkaban.name=Test
azkaban.label=My Local Azkaban
azkaban.color=#FF3601
azkaban.default.servlet.path=/index
web.resource.dir=web/
default.timezone.id=Asia/Shanghai
# Azkaban UserManager class
user.manager.class=azkaban.user.XmlUserManager
user.manager.xml.file=/root/hd/azkaban-exec-server-0.1.0-SNAPSHOT/conf/azkaban-users.xml
# Loader for projects
executor.global.properties=/root/hd/azkaban-exec-server-0.1.0-SNAPSHOT/conf/global.properties
azkaban.project.dir=/root/hd/azkaban-exec-server-0.1.0-SNAPSHOT/bin/projects
#database.type=h2
#h2.path=./h2
#h2.create.tables=true
database.type=mysql
mysql.port=3306
mysql.host=hq666
mysql.database=azkaban_data
mysql.user=hive
mysql.password=hive
mysql.numconnections=100
# Velocity dev mode
velocity.dev.mode=false
# Azkaban Jetty server properties.
jetty.use.ssl=true
jetty.maxThreads=25
jetty.port=8081
jetty.keystore=/root/hd/keystore
jetty.password=****
jetty.keypassword=****
jetty.truststore=/root/hd/keystore
jetty.trustpassword=****
# Azkaban Executor settings
executor.port=12321
# mail settings
mail.sender=
mail.host=
# User facing web server configurations used to construct the user facing server URLs. They are useful when there is a reverse proxy between Azkaban web servers and users.
# enduser -> myazkabanhost:443 -> proxy -> localhost:8081
# when this parameters set then these parameters are used to generate email links.
# if these parameters are not set then jetty.hostname, and jetty.port(if ssl configured jetty.ssl.port) are used.
# azkaban.webserver.external_hostname=myazkabanhost.com
# azkaban.webserver.external_ssl_port=443
# azkaban.webserver.external_port=8081
job.failure.email=
job.success.email=
lockdown.create.projects=false
cache.directory=cache
# JMX stats
jetty.connector.stats=true
executor.connector.stats=true
# Azkaban plugin settings
azkaban.jobtype.plugin.dir=/root/hd/azkaban-exec-server-0.1.0-SNAPSHOT/plugins/jobtypes
#啟用multiple-executor模式
azkaban.use.multiple.executors=true
#在每次分發(fā)job時,先過濾出滿足條件的executor妓笙,然后再做比較篩選
#如最小剩余內(nèi)存,MinimumFreeMemory,過濾器會檢查executor空余內(nèi)存是否會大于6G若河,如果不足6G,則web-server不會將任務(wù)交由該executor執(zhí)行寞宫∠舾#可參考Azkaban Github源碼
#如CpuStatus,過濾器會檢查executor的cpu占用率是否達(dá)到95%辈赋,若達(dá)到95%鲫忍,web-server也不會將任務(wù)交給該executor執(zhí)行≡壳可參考Azkaban Github源碼悟民。
#參數(shù)含義參考官網(wǎng)說明 http://azkaban.github.io/azkaban/docs/latest/#configuration
#由于是虛擬機(jī),不需要過濾焕蹄,只需要比較即可
#azkaban.executorselector.filters=StaticRemainingFlowSize,MinimumFreeMemory,CpuStatus
#某個任務(wù)是否指定了executor id
azkaban.executorselector.comparator.NumberOfAssignedFlowComparator=1
#內(nèi)存
azkaban.executorselector.comparator.Memory=1
#最后一次被分發(fā)
azkaban.executorselector.comparator.LastDispatched=1
#CPU
azkaban.executorselector.comparator.CpuUsage=1
在azkaban_data庫executors表中添加executor
mysql> insert into executors(host,port,active) values("192.168.222.110",12321,1);
mysql> insert into executors(host,port,active) values("192.168.222.111",12321,1);
注:這里把a(bǔ)ctive設(shè)置為1(激活狀態(tài))逾雄。
啟動node1 web-server、node3 exec-server、node4 exec-server
先啟動exec-server鸦泳,再啟動 web-server
./start-exec.sh
./start-web.sh
瀏覽器訪問
https://ip:8443