获取编译好的文件
获取编译好的安装文件上传并解压/root/hd/azkaban-3.50.0
找到三个需要的配置文件
azkaban-db/build/distributions
azkaban-web-server/build/distributions
azkaban-exec-server/build/distributions
distributions下就是我们需要的编译后的压缩文件
把压缩文件分别分发到对应的服务器
在azkaban-db/build/distributions下 只需获取create-all-sql-0.1.0-SNAPSHOT.sql 创建数据库表
分布式multiple-executor模式安装部署
任务分配如下
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 ;
注意 如果导入数据过程报错 索引过长 更改数据库编码 删除所有表 重新导入数据
拷贝web-server到node1
解压
生成ssl
keytool -keystore keystore -alias jetty -genkey -keyalg RSA
注:密码和最后确认需要输入,其他默认即可。生成keystore复制到exe所在服务器为配置准备
设置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
// 配置内容如下
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
#在每次分发job时,先过滤出满足条件的executor,然后再做比较筛选
#如最小剩余内存,MinimumFreeMemory,过滤器会检查executor空余内存是否会大于6G,如果不足6G,则web-server不会将任务交由该executor执行。可参考Azkaban Github源码
#如CpuStatus,过滤器会检查executor的cpu占用率是否达到95%,若达到95%,web-server也不会将任务交给该executor执行。可参考Azkaban Github源码。
#参数含义参考官网说明 http://azkaban.github.io/azkaban/docs/latest/#configuration
#由于是虚拟机,不需要过滤,只需要比较即可
#azkaban.executorselector.filters=StaticRemainingFlowSize,MinimumFreeMemory,CpuStatus
#某个任务是否指定了executor id
azkaban.executorselector.comparator.NumberOfAssignedFlowComparator=1
#内存
azkaban.executorselector.comparator.Memory=1
#最后一次被分发
azkaban.executorselector.comparator.LastDispatched=1
#CPU
azkaban.executorselector.comparator.CpuUsage=1
注意涉及到路径都写绝对路径
设置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
#在每次分发job时,先过滤出满足条件的executor,然后再做比较筛选
#如最小剩余内存,MinimumFreeMemory,过滤器会检查executor空余内存是否会大于6G,如果不足6G,则web-server不会将任务交由该executor执行。可参考Azkaban Github源码
#如CpuStatus,过滤器会检查executor的cpu占用率是否达到95%,若达到95%,web-server也不会将任务交给该executor执行。可参考Azkaban Github源码。
#参数含义参考官网说明 http://azkaban.github.io/azkaban/docs/latest/#configuration
#由于是虚拟机,不需要过滤,只需要比较即可
#azkaban.executorselector.filters=StaticRemainingFlowSize,MinimumFreeMemory,CpuStatus
#某个任务是否指定了executor id
azkaban.executorselector.comparator.NumberOfAssignedFlowComparator=1
#内存
azkaban.executorselector.comparator.Memory=1
#最后一次被分发
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);
注:这里把active设置为1(激活状态)。
启动node1 web-server、node3 exec-server、node4 exec-server
先启动exec-server,再启动 web-server
./start-exec.sh
./start-web.sh
浏览器访问
https://ip:8443