https://github.com/azkaban/azkaban
git clone https://github.com/azkaban/azkaban.git
或wget azkaban.version url
二.编译
o build Azkaban packages from source, run:
./gradlew distTar
The above command builds all Azkaban packages and packages them into GZipped Tar archives. To build Zip archives, run:
./gradlew distZip
If not building for the first time, it's good to clean first:
./gradlew clean
三.安装配置
cd /opt
tar zxvf azkaban-exec-server-3.1.0.tar.gz
tar zxvf azkaban-web-server-3.1.0.tar.gz
tar zxvf azkaban-sql-3.1.0.tar.gz
mysql> use azkaban;
mysql> source /opt/azkaban-sql-3.1.0/create-all-sql-3.1.0.sql
keytool -keystore keystore -alias jetty -genkey -keyalg RSA
1.webserver,
conf/azkaban.properties关注点,配置路径用绝对路径, keystore密码
# Azkaban Personalization Settings
azkaban.name=Test
azkaban.label=My Local Azkaban
azkaban.color=#FF3601
azkaban.default.servlet.path=/index
web.resource.dir=/opt/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=conf/azkaban-users.xml
# Loader for projects
executor.global.properties=conf/global.properties
azkaban.project.dir=projects
database.type=mysql
mysql.port=3306
mysql.host=172.18.203.131
mysql.database=azkaban
mysql.user=root
mysql.password=rootROOT1.
mysql.numconnections=100
# Velocity dev mode
velocity.dev.mode=false
# Azkaban Jetty server properties.
jetty.maxThreads=25
jetty.ssl.port=8443
# jetty.use.ssl=false
jetty.port=8081
jetty.keystore=keystore
jetty.password=password(记得改成keystore中密码)
jetty.keypassword=keypassword(记得改成keystore中密码)
jetty.truststore=keystore
jetty.trustpassword=password(记得改成keystore中密码)
jetty.excludeCipherSuites=SSL_RSA_WITH_DES_CBC_SHA,SSL_DHE_RSA_WITH_DES_CBC_SHA,SSL_DHE_DSS_WITH_DES_CBC_SHA,SSL_RSA_EXPORT_WITH_RC4_40_MD5,SSL_RSA_EXPORT_WITH_DES40_CBC_SHA,SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA,SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA,SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA,TLS_DHE_RSA_WITH_AES_256_CBC_SHA256,TLS_DHE_DSS_WITH_AES_256_CBC_SHA256,TLS_DHE_RSA_WITH_AES_256_CBC_SHA,TLS_DHE_DSS_WITH_AES_256_CBC_SHA,TLS_DHE_RSA_WITH_AES_128_CBC_SHA256,TLS_DHE_DSS_WITH_AES_128_CBC_SHA256,TLS_DHE_RSA_WITH_AES_128_CBC_SHA,TLS_DHE_DSS_WITH_AES_128_CBC_SHA
# Azkaban Executor settings
executor.port=12321
# mail settings
mail.sender=
mail.host=
job.failure.email=
job.success.email=
lockdown.create.projects=false
cache.directory=cache
# JMX stats
jetty.connector.stats=true
executor.connector.stats=true
conf 目录,修改 azkaban-users.xml
conf 目录,修改 log4j.properties
log4j.rootLogger=INFO,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
2.excutor server
# Azkaban
default.timezone.id=Asia/Shanghai
# Azkaban JobTypes Plugins
azkaban.jobtype.plugin.dir=/opt/azkaban/azkaban-exec-server-0.1.0-SNAPSHOTplugins/jobtypes
# Loader for projects
executor.global.properties=conf/global.properties
azkaban.project.dir=projects
database.type=mysql
mysql.port=3306
mysql.host=172.18.203.131
mysql.database=azkaban
mysql.user=root
mysql.password=rootROOT1.
mysql.numconnections=100
# Azkaban Executor settings
executor.maxThreads=50
executor.port=12321
executor.flow.threads=30
# JMX stats
jetty.connector.stats=true
executor.connector.stats=true
# uncomment to enable inmemory stats for azkaban
#executor.metric.reports=true
#executor.metric.milisecinterval.default=60000
3.修改 /plugins/jobtypes、commonprivate.properties避免很多报错
# set execute-as-user
execute.as.user=false
memCheck.enabled=false
azkaban.native.lib=false
四.任务创建:
cat > /opt/azkaban/azkaban-exec-server-0.1.0-SNAPSHOT/projects/foo.job
type=command
command=echo "Hello World"
cat > /opt/azkaban-exec-server-0.1.0-SNAPSHOT/projects/bar.job
type=command
dependencies=foo
command=echo "bar"
五.任务压缩打包, 登录上传,配置定时任务
https://172.18.203.131:8443 azkaban azkaban