1.下載
可直接git clone 下來(lái),或者到
https://github.com/azkaban/azkaban/releases
這里下載對(duì)應(yīng)的版本办悟。
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
目錄下吮螺,執(zhí)行mkdir azkaban
新建目錄雳灵,其路徑為/Users/kevin/azkaban/
4.將build后的tar包c(diǎn)p到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(如果已經(jīng)安裝幢痘,可跳過(guò))
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.設(shè)置mysql賬號(hào)
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.導(dǎo)入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
#設(shè)置項(xiàng)目名稱
azkaban.name=Test
#設(shè)置項(xiàng)目副標(biāo)題
azkaban.label=My Local Azkaban
azkaban.color=#FF3601
azkaban.default.servlet.path=/index
web.resource.dir=web/
#一定要設(shè)置為上海龙誊,否則按美國(guó)時(shí)間執(zhí)行
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賬號(hào)
#mail.host=email服務(wù)器
#mail.user=email賬號(hào)
#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.啟動(dòng)Web服務(wù)
進(jìn)入到
/Users/kevin/azkaban/azkaban-web-server-0.1.0-SNAPSHOT
下執(zhí)行啟動(dòng):
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.啟動(dòng)exec服務(wù)
進(jìn)入到
/Users/kevin/azkaban/azkaban-exec-server-0.1.0-SNAPSHOT
下執(zhí)行啟動(dòng):
bin/azkaban-executor-start.sh
停止:
bin/azkaban-executor-shutdown.sh
注意:
- 沒有特殊需求趟大,需關(guān)閉
execute.as.user=false
鹤树,在azkaban-exec-server-0.1.0-SNAPSHOT
目錄下新建plugins/jobtypes
,創(chuàng)建文件commonprivate.properties
逊朽,其配置為execute.as.user=false
罕伯。