1 安装前准备
1.1 将Azkaban Web服务器、Azkaban执行服务器、Azkaban的sql执行脚本及MySQL安装包拷贝到node09:/opt/software目录下
[root@node09 09_azkaban
]
total 98600
-rw-r--r--. 1 root root 11157302 Aug 19 15:11 azkaban-executor-server-2.5.0.tar.gz
-rw-r--r--. 1 root root 1928 Aug 19 15:11 azkaban-sql-script-2.5.0.tar.gz
-rw-r--r--. 1 root root 11989669 Aug 19 15:11 azkaban-web-server-2.5.0.tar.gz
-rw-r--r--. 1 root root 77807942 Aug 19 15:11 mysql-libs.zip
1.2 选择Mysql作为Azkaban数据库,因为Azkaban建立了一些Mysql连接增强功能,以方便Azkaban设置,并增强服务可靠性。(参见hive文档2.4)
2 安装Azkaban
2.1 在/opt/module/目录下创建azkaban目录
[root@node09 module
]
2.2 解压azkaban-web-server-2.5.0.tar.gz、azkaban-executor-server-2.5.0.tar.gz、azkaban-sql-script-2.5.0.tar.gz到/opt/module/azkaban目录下
[root@node09 09_azkaban
]
[root@node09 09_azkaban
]
[root@node09 09_azkaban
]
2.3 对解压后的文件重新命名
[root@node09 azkaban
]
[root@node09 azkaban
]
2.4 azkaban脚本导入
进入mysql,创建azkaban数据库,并将解压的脚本导入到azkaban数据库。
[root@node09 azkaban
]
mysql
> create database azkaban
;
mysql
> use azkaban
;
mysql
> source /opt/module/azkaban/azkaban-2.5.0/create-all-sql-2.5.0.sql
注:source后跟.sql文件,用于批量处理.sql文件中的sql语句。
3 生成密钥库
Keytool:是java数据证书的管理工具,使用户能够管理自己的公/私钥对及相关证书。 -keystore:指定密钥库的名称及位置(产生的各类信息将不在.keystore文件中) -genkey:在用户主目录中创建一个默认文件".keystore" -alias:对我们生成的.keystore进行指认别名;如果没有默认是mykey -keyalg:指定密钥的算法 RSA/DSA 默认是DSA
3.1 生成 keystore的密码及相应信息的密钥库
[root@node09 azkaban
]
输入密钥库口令:
再次输入新口令:
您的名字与姓氏是什么?
[Unknown
]:
您的组织单位名称是什么?
[Unknown
]:
您的组织名称是什么?
[Unknown
]:
您所在的城市或区域名称是什么?
[Unknown
]:
您所在的省/市/自治区名称是什么?
[Unknown
]:
该单位的双字母国家/地区代码是什么?
[Unknown
]:
CN
=Unknown, OU
=Unknown, O
=Unknown, L
=Unknown, ST
=Unknown, C
=Unknown是否正确?
[否
]: y
输入
<jetty
> 的密钥口令
(如果和密钥库口令相同, 按回车
):
再次输入新口令:
注意:
密钥库的密码至少必须6个字符,可以是纯数字或者字母或者数字和字母的组合等等
密钥库的密码最好和
<jetty
> 的密钥相同,方便记忆
3.2 将keystore 拷贝到 azkaban web服务器根目录中
[root@node09 azkaban
]
4 时间同步配置
先配置好服务器节点上的时区
4.1 如果在/usr/share/zoneinfo/这个目录下不存在时区配置文件Asia/Shanghai,就要用 tzselect 生成。
[root@node09 zoneinfo
]
-rw-r--r--. 5 root root 388 May 9 2018 Shanghai
[root@node09 zoneinfo
]
Please identify a location so that
time zone rules can be
set correctly.
Please
select a continent or ocean.
1
) Africa
2
) Americas
3
) Antarctica
4
) Arctic Ocean
5
) Asia
6
) Atlantic Ocean
7
) Australia
8
) Europe
9
) Indian Ocean
10
) Pacific Ocean
11
) none - I want to specify the
time zone using the Posix TZ format.
Please
select a country.
1
) Afghanistan 18
) Israel 35
) Palestine
2
) Armenia 19
) Japan 36
) Philippines
3
) Azerbaijan 20
) Jordan 37
) Qatar
4
) Bahrain 21
) Kazakhstan 38
) Russia
5
) Bangladesh 22
) Korea
(North
) 39
) Saudi Arabia
6
) Bhutan 23
) Korea
(South
) 40
) Singapore
7
) Brunei 24
) Kuwait 41
) Sri Lanka
8
) Cambodia 25
) Kyrgyzstan 42
) Syria
9
) China 26
) Laos 43
) Taiwan
10
) Cyprus 27
) Lebanon 44
) Tajikistan
11
) East Timor 28
) Macau 45
) Thailand
12
) Georgia 29
) Malaysia 46
) Turkmenistan
13
) Hong Kong 30
) Mongolia 47
) United Arab Emirates
14
) India 31
) Myanmar
(Burma
) 48
) Uzbekistan
15
) Indonesia 32
) Nepal 49
) Vietnam
16
) Iran 33
) Oman 50
) Yemen
17
) Iraq 34
) Pakistan
Please
select one of the following
time zone regions.
1
) Beijing Time
2
) Xinjiang Time
The following information has been given:
China
Beijing Time
Therefore TZ
='Asia/Shanghai' will be used.
Local
time is now: Thu Oct 18 16:24:23 CST 2018.
Universal Time is now: Thu Oct 18 08:24:23 UTC 2018.
Is the above information OK?
1
) Yes
2
) No
You can
make this change permanent
for yourself by appending the line
TZ
='Asia/Shanghai'; export TZ
to the
file '.profile' in your home directory
; then log out and log
in again.
Here is that TZ value again, this
time on standard output so that you
can use the /usr/bin/tzselect
command in shell scripts:
Asia/Shanghai
4.2 拷贝该时区文件,覆盖系统本地时区配置(如果时区选择是上海的,可以忽略)
[root@node09 azkaban
]
4.3 集群时间同步
可以参考之前的 1.Centos7.6 环境准备 11. 集群时间同步
5 配置文件
5.1 Web服务器配置
1)进入azkaban web服务器安装目录 conf目录,打开azkaban.properties文件
[root@node09 conf
]
/opt/module/azkaban/server/conf
[root@node09 conf
]
2)按照如下配置修改azkaban.properties文件。
azkaban.name
= schedule system
azkaban.label
=My Local Azkaban
azkaban.color
=
azkaban.default.servlet.path
=/index
web.resource.dir
=/opt/module/azkaban/server/web/
default.timezone.id
=Asia/Shanghai
user.manager.class
=azkaban.user.XmlUserManager
user.manager.xml.file
=/opt/module/azkaban/server/conf/azkaban-users.xml
executor.global.properties
=/opt/module/azkaban/executor/conf/global.properties
azkaban.project.dir
=projects
database.type
=mysql
mysql.port
=3306
mysql.host
=node09
mysql.database
=azkaban
mysql.user
=root
mysql.password
=000000
mysql.numconnections
=100
velocity.dev.mode
=false
jetty.maxThreads
=25
jetty.ssl.port
=8443
jetty.port
=8081
jetty.keystore
=/opt/module/azkaban/server/keystore
jetty.password
=000000
jetty.keypassword
=000000
jetty.truststore
=/opt/module/azkaban/server/keystore
jetty.trustpassword
=000000
executor.port
=12321
mail.sender
=
mail.host
=
job.failure.email
=
job.success.email
=
lockdown.create.projects
=false
cache.directory
=cache
3)web服务器用户配置 在azkaban web服务器安装目录 conf目录,按照如下配置修改azkaban-users.xml 文件,增加管理员用户。
[root@node09 conf
]
<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" /
>
<role name
="admin" permissions
="ADMIN" /
>
<role name
="metrics" permissions
="METRICS"/
>
</azkaban-users
>
5.2 执行服务器配置
1)进入执行服务器安装目录conf,打开azkaban.properties
[root@node09 conf
]
/opt/module/azkaban/executor/conf
[root@node09 conf
]
2) 按照如下配置修改azkaban.properties文件。
default.timezone.id
=Asia/Shanghai
azkaban.jobtype.plugin.dir
=plugins/jobtypes
executor.global.properties
=/opt/module/azkaban/executor/conf/global.properties
azkaban.project.dir
=projects
database.type
=mysql
mysql.port
=3306
mysql.host
=node09
mysql.database
=azkaban
mysql.user
=root
mysql.password
=000000
mysql.numconnections
=100
executor.maxThreads
=50
executor.port
=12321
executor.flow.threads
=30
6 启动executor服务器
在executor服务器目录下执行启动命令
[root@node09 executor
]
/opt/module/azkaban/executor
[root@node09 executor
]
7 启动web服务器
在azkaban web服务器目录下执行启动命令
[root@node09 server
]
/opt/module/azkaban/server
[root@node09 server
]
注意: 先执行executor,再执行web,避免Web Server会因为找不到执行器启动失败。 jps查看进程
[root@node09 server
]
3601 AzkabanExecutorServer
5880 Jps
3661 AzkabanWebServer
启动完成后,在浏览器(建议使用谷歌浏览器)中输入https://服务器IP地址:8443,即可访问azkaban服务了。 在登录中输入刚才在azkaban-users.xml文件中新添加的户用名及密码,点击 login。
8.web error 处理
直接使用http请求,会抛出以下异常
[root@node09 executor
]
javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake
at sun.security.ssl.SSLSocketImpl.readRecord
(SSLSocketImpl.java:994
)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake
(SSLSocketImpl.java:1367
)
at sun.security.ssl.SSLSocketImpl.startHandshake
(SSLSocketImpl.java:1395
)
at sun.security.ssl.SSLSocketImpl.startHandshake
(SSLSocketImpl.java:1379
)
at org.mortbay.jetty.security.SslSocketConnector
$SslConnection.run
(SslSocketConnector.java:708
)
at org.mortbay.thread.QueuedThreadPool
$PoolThread.run
(QueuedThreadPool.java:582
)
Caused by: java.io.EOFException: SSL peer shut down incorrectly
at sun.security.ssl.InputRecord.read
(InputRecord.java:505
)
at sun.security.ssl.SSLSocketImpl.readRecord
(SSLSocketImpl.java:975
)
注意 之前一直不能打开是因为使用了http,这里强调一下,一定不能用http,必须用https