一个完整的数据分析系统通常都是由大量任务单元组成:
shell脚本程序,java程序,mapreduce程序、hive脚本等
各任务单元之间存在时间先后及前后依赖关系
为了很好地组织起这样的复杂执行计划,需要一个工作流调度系统来调度执行
所需软件:
Azkaban Web服务安装包
azkaban-web-server-0.1.0-SNAPSHOT.tar.gz
Azkaban执行服务安装包
azkaban-exec-server-0.1.0-SNAPSHOT.tar.gz
编译之后的sql脚本
create-all-sql-0.1.0-SNAPSHOT.sql
数据库准备
进入mysql的客户端执行以下命令
mysql -uroot -p
CREATE DATABASE azkaban;
CREATE USER 'azkaban'@'%' IDENTIFIED BY 'azkaban';
GRANT all privileges ON azkaban.* to 'azkaban'@'%' identified by 'azkaban' WITH GRANT OPTION;
use azkaban;
source /export/softwares/create-all-sql-0.1.0-SNAPSHOT.sql;
解压软件安装包
解压azkaban-web-server
cd /export/softwares
tar -zxvf azkaban-web-server-0.1.0-SNAPSHOT.tar.gz -C ../servers/
cd /export/servers
mv azkaban-web-server-0.1.0-SNAPSHOT/ azkaban-web-server-3.47.0
解压azkaban-exec-server
cd /export/softwares
tar -zxvf azkaban-exec-server-0.1.0-SNAPSHOT.tar.gz -C ../servers/
cd /export/servers
mv azkaban-exec-server-0.1.0-SNAPSHOT/ azkaban-exec-server-3.47.0
cd /export/servers/azkaban-web-server-3.47.0
keytool -keystore keystore -alias jetty -genkey -keyalg RSA
配置azkaban-web-server
cp -r /export/servers/azkaban-solo-server-0.1.0-SNAPSHOT/conf/ /export/servers/azkaban-web-server-3.47.0/
修改azkaban-web-server的配置文件
cd /export/servers/azkaban-web-server-3.47.0/conf
vim azkaban.properties
# Azkaban Personalization Settings
azkaban.name=MyAzkaban
azkaban.label=My 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
database.type=mysql
mysql.port=3306
mysql.host=node03
mysql.database=azkaban
mysql.user=azkaban
mysql.password=azkaban
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=/export/servers/azkaban-web-server-3.47.0/keystore
jetty.password=azkaban
jetty.keypassword=azkaban
jetty.truststore=/export/servers/azkaban-web-server-3.47.0/keystore
jetty.trustpassword=azkaban
# 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=
# JMX stats
jetty.connector.stats=true
executor.connector.stats=true
# Azkaban plugin settings
azkaban.jobtype.plugin.dir=plugins/jobtypes
添加log4j.properties的配置文件
cd /export/servers/azkaban-web-server-3.47.0/conf
vim log4j.properties
log4j.rootLogger=INFO, Console
log4j.appender.Console=org.apache.log4j.ConsoleAppender
log4j.appender.Console.layout=org.apache.log4j.PatternLayout
log4j.appender.Console.layout.ConversionPattern=%d{yyyy/MM/dd HH:mm:ss.SSS Z} %p [%c{1}] %m%n
log4j.category.velocity=INFO
azkaban executor server 安装
将azkaban-web-server的conf目录拷贝到azkaban-executor-server的安装路径下
cd /export/servers
cp -r /export/servers/azkaban-web-server-3.47.0/conf/ /export/servers/azkaban-exec-server-3.47.0/
创建插件存放的文件夹目录
mkdir -p /export/servers/azkaban-exec-server-3.47.0/plugins/jobtypes 或者
cp /export/softwares/execute-as-user.c /export/servers/azkaban-exec-server-3.47.0/plugins/jobtypes/
然后执行以下命令生成execute-as-user
yum -y install gcc-c++
cd /export/servers/azkaban-exec-server-3.47.0/plugins/jobtypes
gcc execute-as-user.c -o execute-as-user
chown root execute-as-user
chmod 6050 execute-as-user
如果提示gcc command not found 那么就在线安装gcc+c++即可。 任意目录执行命令 yum -y install gcc-c++
编辑文件
cd /export/servers/azkaban-exec-server-3.47.0/plugins/jobtypes
vim commonprivate.properties
execute.as.user=false
memCheck.enabled=false
azkaban.native.lib=/export/servers/azkaban-exec-server-3.47.0/plugins/jobtypes
最终生成如下
cd /export/servers/azkaban-web-server-3.47.0
bin/start-web.sh
cd /export/servers/azkaban-exec-server-3.47.0
bin/start-exec.sh
注:访问地址:
https://node03:8443