1.下载Azkaban的源码
wget https://github.com/azkaban/azkaban/archive/3.38.0.tar.gz
tar -zxvf azkaban-3.38.0.tar.gz -C /opt/source/
cd azkaban-3.38.0/
wget https://services.gradle.org/distributions/gradle-4.1-all.zip
2.Azkaban的部署模式
模式介绍
1.solo server mode,依赖自带的H2数据库,web server和executor server在同一个线程。测试或者小规模的案例可以用。
2.two sercer mode,需要mysql作为元数据库,web server和executor server在不同一个线程
3.multiple executor mode,2模式的扩展,可以有多个executor server
安装使用第2种模式
解压
解压azkaban-3.38.0.tar.gz到/opt/source,解压后目录结构说明如下所示
目录结构:
azkaban-common 常用的工具类(基础架构)
azkaban-db 与数据库相关的
azkaban-exec-server 执行的server
azkaban-hadoop-security-plugin hadoop安全的插件(不用去管它)
azkaban-solo-server 我们所要部署的模式
azkaban-spi 存储一些接口相关的东西(异常处理这些)
azkaban-web-server web-server(ui上的东西)
3.编译
cp /gradle-4.1-all.zip /opt/source/azkaban-3.38.0/gradle/wrapper
cd /opt/source/azkaban-3.38.0/gradle/wrapper
vi gradle-wrapper.properties
distributionUrl=gradle-4.1-all.zip
#distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
编译,时间会比较慢 build
./gradlew installDist
如果不是第一次编译,最好先clean一下
./gradlew clean
azkaban-db,存放建表的语句
azkaban-exec-server,执行服务
azkaban-solo-server,solo模式使用
azkaban-web-server,web服务
4.创建Azkaban元数据库
sql脚本在azkaban-db文件中,可以先创建一个azkaban数据库和用户
mysql> use azkaban;
mysql> source [sql脚本目录]。有一个全的,名字里带all
5.配置 keystore
keytool -keystore keystore -alias jetty -genkey -keyalg RSA
Enter keystore password: 123456
what is your first and last name: xxxx
what is the name of your organizational unit: xxxx
what is the name of your organization: xxxx
what is the name of your City or Locality: xxxx
what is the name of your State or Province: xxxx
what is the two_letter country code for this unit: CN
将生成的keystone文件拷贝到web-server的安装目录下,和conf等目录同级
6.创建必要目录
azkaban-exec-server 、Azkaban-web-server必须有以下目录
bin 启动脚本存放目录
conf 配置文件存放目录(没有的话从solo-server的目录中拷贝过来)
lib 依赖jar包存放目录extlib 附加jar包存放目录(没有的话手动创建)
plugins 插件安装目录web (没有的话从solo-server的目录中拷贝过来)
web 资源文件
logs 日志文件(手动创建)
7.配置文件
7.1.azkaban-web-server azkaban.properties
cd /opt/source/azkaban-3.38.0/azkaban-web-server/build/install/azkaban-web-server/conf
vi 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/ #如果azkaban页面打不开,就换成绝对路径
# 最好用绝对路径,不然界面可能会诡异的丑
default.timezone.id=Asia/Shanghai
# Azkaban UserManager class
user.manager.class=azkaban.user.XmlUserManager
user.manager.xml.file=conf/azkaban-users.xml
# Loader for projects
executor.global.properties=conf/global.properties
azkaban.project.dir=projects
database.type=h2
h2.path=./h2
h2.create.tables=true
# Velocity dev mode
velocity.dev.mode=false
# db
database.type=mysql
mysql.port=3306
mysql.host=IP #修改的地方
mysql.database=azkaban #修改的地方
mysql.user=azkaban #修改的地方
mysql.password=azkaban #修改的地方
mysql.numconnections=100 #修改的地方
# Azkaban Jetty server properties.
jetty.use.ssl=false
jetty.maxThreads=25
jetty.port=8058
# 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=plugins/jobtypes
用户权限登录设置
vi azkaban-users.xml
vi log4j.properties
log4j.rootLogger=DEBUG,C
log4j.appender.C=org.apache.log4j.ConsoleAppender
log4j.appender.C.Target=System.err
log4j.appender.C.layout=org.apache.log4j.PatternLayout
log4j.appender.C.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n
配置azkaban-exec-server azkaban.properties
cd /opt/source/azkaban-3.38.0/azkaban-exec-server/build/install/azkaban-exec-server
vi 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=conf/azkaban-users.xml
# Loader for projects
executor.global.properties=conf/global.properties
azkaban.project.dir=projects
database.type=h2
h2.path=./h2
h2.create.tables=true
# Velocity dev mode
velocity.dev.mode=false
# Azkaban Jetty server properties.
jetty.use.ssl=false
jetty.maxThreads=25
jetty.port=8081
# db
database.type=mysql
mysql.port=3306
mysql.host=ip #需要修改的地方
mysql.database=azkaban #需要修改的地方
mysql.user=azkaban #需要修改的地方
mysql.password=azkaban #需要修改的地方
mysql.numconnections=100
# Azkaban Executor settings
executor.port=12321
# mail settings
mail.sender=***@66.com
mail.host=10.8.***.***
mail.user=***@66.com
mail.password=***
mail.port=25
# 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=plugins/jobtypes
8.启动
1.先启动exec-server
bin目录下,azkaban-executor-start.sh
cd /opt/source/azkaban-3.38.0/azkaban-exec-server/build/install/azkaban-exec-server/
执行 bin/ azkaban-executor-start.sh
(或者到bin目录下执行./azkaban-executor-start.sh
)
cd /opt/source/azkaban-3.38.0/azkaban-web-server/build/install/azkaban-web-server/
执行 bin/ azkaban-web-start.sh
(或者到bin目录下执行./azkaban-web-start.sh
)
3.检查进程
jps