1.下载
可直接git clone 下来,或者到
https://github.com/azkaban/azkaban/releases
这里下载对应的版本。
git clone https://github.com/azkaban/azkaban.git
2.build
# Build Azkaban
./gradlew build
# Clean the build
./gradlew clean
# Build and install distributions
./gradlew installDist
# Run tests
./gradlew test
# Build without running tests
./gradlew build -x test
3.新建azkaban
比如我在
/Users/kevin
目录下,执行mkdir azkaban
新建目录,其路径为/Users/kevin/azkaban/
4.将build后的tar包cp到azkaban
目录下
cp azkaban/azkaban-web-server/build/distributions/azkaban-web-server-0.1.0-SNAPSHOT.tar.gz /Users/kevin/azkaban/
cp azkaban/azkaban-exec-server/build/distributions/azkaban-exec-server-0.1.0-SNAPSHOT.tar.gz /Users/kevin/azkaban/
cp azkaban/azkaban-db/build/distributions/azkaban-db-0.1.0-SNAPSHOT.tar.gz /Users/kevin/azkaban/
5.安装mysql(如果已经安装,可跳过)
wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
rpm -ivh mysql-community-release-el7-5.noarch.rpm
yum install mysql-community-server
systemctl status mysqld.service
6.设置mysql账号
mysql -uroot
mysql> set password for 'root'@'localhost' = password('mysql');
Query OK, 0 rows affected (0.00 sec)
mysql> CREATE DATABASE azkaban;
Query OK, 1 row affected (0.01 sec)
mysql> CREATE USER 'azkaban'@'%' IDENTIFIED BY 'azkaban';
Query OK, 0 rows affected (0.01 sec)
mysql> GRANT ALL ON azkaban.* to 'azkaban'@'localhost' IDENTIFIED BY 'azkaban';
Query OK, 0 rows affected (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
7.导入azkaban sql
mysql> use azkaban;
mysql> source /Users/kevin/azkaban/azkaban-db-0.1.0-SNAPSHOT/create-all-sql-0.1.0-SNAPSHOT.sql
8.配置azkaban-web-server
在
azkaban-web-server-0.1.0-SNAPSHOT
目录下,新建conf
目录,其文件夹目录如下:
├── conf
│ ├── azkaban-users.xml
│ ├── azkaban.properties
│ ├── global.properties
│ └── log4j.properties
azkaban-users.xml
<azkaban-users>
<user username="azkaban" password="azkaban" roles="admin" groups="azkaban" />
<user username="metrics" password="metrics" roles="metrics"/>
<user username="admin" password="admin" roles="admin,metrics" />
<role name="admin" permissions="ADMIN" />
<role name="metrics" permissions="METRICS"/>
</azkaban-users>
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=mysql
mysql.port=3306
mysql.host=127.0.0.1
mysql.database=azkaban
mysql.user=root
mysql.password=root
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
jetty.keypassword=keypassword
jetty.truststore=keystore
jetty.trustpassword=password
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=email账号
#mail.host=email服务器
#mail.user=email账号
#mail.password=email密码
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
global.properties
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
9.启动Web服务
进入到
/Users/kevin/azkaban/azkaban-web-server-0.1.0-SNAPSHOT
下执行启动:
bin/azkaban-web-start.sh
停止:
bin/azkaban-web-shutdown.sh
10.配置azkaban-exec-server
在
azkaban-exec-server-0.1.0-SNAPSHOT
目录下,新建conf
目录,其文件夹目录如下:
├── conf
│ ├── azkaban.properties
azkaban.properties
# Azkaban
default.timezone.id=Asia/Shanghai
# Azkaban JobTypes Plugins
azkaban.jobtype.plugin.dir=plugins/jobtypes
# Loader for projects
executor.global.properties=conf/global.properties
azkaban.project.dir=projects
database.type=mysql
mysql.port=3306
mysql.host=127.0.0.1
mysql.database=azkaban
mysql.user=root
mysql.password=root
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
11.启动exec服务
进入到
/Users/kevin/azkaban/azkaban-exec-server-0.1.0-SNAPSHOT
下执行启动:
bin/azkaban-executor-start.sh
停止:
bin/azkaban-executor-shutdown.sh
注意:
- 没有特殊需求,需关闭
execute.as.user=false
,在azkaban-exec-server-0.1.0-SNAPSHOT
目录下新建plugins/jobtypes
,创建文件commonprivate.properties
,其配置为execute.as.user=false
。
网友评论