[root@bigdata001 opt]#
[root@bigdata001 opt]# wget -O azkaban-3.90.0.tar.gz https://codeload.github.com/azkaban/azkaban/tar.gz/refs/tags/3.90.0
[root@bigdata001 opt]#
[root@bigdata001 opt]# tar -zxvf azkaban-3.90.0.tar.gz
[root@bigdata001 opt]#
[root@bigdata001 opt]# cd azkaban-3.90.0
[root@bigdata001 azkaban-3.90.0]#
添加SSL发送邮件:修改azkaban-common/src/main/java/azkaban/utils/EmailMessage.java中的sendEmail()方法,为props添加属性props.put("mail.smtp.socketFactory.class", "javax.net.ssl.SSLSocketFactory");
Web界面中History菜单的高级过滤条件,进行时间过滤时(Start Time和End Time都要介于所选的开始时间和结束时间之间),会报异常:
HTTP ERROR 500
Problem accessing /history. Reason:
Invalid format: "02/09/2022 1:48 PM" is malformed at "PM"
Caused by:
java.lang.IllegalArgumentException: Invalid format: "02/09/2022 1:48 PM" is malformed at "PM"
at org.joda.time.format.DateTimeFormatter.parseDateTime(DateTimeFormatter.java:866)
at azkaban.webapp.servlet.HistoryServlet.handleHistoryPage(HistoryServlet.java:106)
at azkaban.webapp.servlet.HistoryServlet.handleGet(HistoryServlet.java:60)
at azkaban.webapp.servlet.LoginAbstractAzkabanServlet.doGet(LoginAbstractAzkabanServlet.java:122)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:770)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:401)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:326)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:928)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:549)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
at org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228)
at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
Powered by Jetty://
解决方法:修改/opt/azkaban-3.85.5/azkaban-web-server/src/main/java/azkaban/webapp/servlet/HistoryServlet.java的handleHistoryPage方法,在两处DateTimeFormat.forPattern(FILTER_BY_DATE_PATTERN)
后添加.withLocale(java.util.Locale.ENGLISH)
[root@bigdata001 azkaban-3.90.0]#
[root@bigdata001 azkaban-3.90.0]# ./gradlew build -x test
[root@bigdata001 azkaban-3.90.0]#
[root@bigdata001 azkaban-3.90.0]# ./gradlew installDist
[root@bigdata001 azkaban-3.90.0]#
将azkaban-3.90.0/azkaban-db/build/distributions/azkaban-db-0.1.0-SNAPSHOT.tar.gz中的create-all-sql-0.1.0-SNAPSHOT.sql,上传到mysql所在服务器的/opt目录下
[root@bigdata005 opt]#
[root@bigdata005 opt]# mysql -u root -pRoot_123
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 183
Server version: 8.0.25 MySQL Community Server - GPL
Copyright (c) 2000, 2021, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
mysql> CREATE DATABASE azkaban;
Query OK, 1 row affected (0.01 sec)
mysql>
mysql> GRANT SELECT,INSERT,UPDATE,DELETE ON azkaban.* to 'root'@'%' WITH GRANT OPTION;
Query OK, 0 rows affected (0.01 sec)
mysql>
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql>
mysql> use azkaban;
Database changed
mysql>
mysql> source /opt/create-all-sql-0.1.0-SNAPSHOT.sql
mysql>
可以参考以下步骤部署多个Executor Server
[root@bigdata001 opt]#
[root@bigdata001 opt]# mkdir azkaban
[root@bigdata001 opt]#
[root@bigdata001 opt]# cp -r /opt/azkaban-3.90.0/azkaban-exec-server/build/install/azkaban-exec-server azkaban/
[root@bigdata001 opt]#
[root@bigdata001 opt]# cd azkaban
[root@bigdata001 azkaban]#
[root@bigdata001 azkaban]# ls
azkaban-exec-server
[root@bigdata001 azkaban]#
[root@bigdata001 azkaban]# cd azkaban-exec-server/
[root@bigdata001 azkaban-exec-server]#
[root@bigdata001 azkaban-exec-server]# ls
bin conf lib plugins
[root@bigdata001 azkaban-exec-server]#
修改内容如下:
default.timezone.id=Asia/Shanghai
executor.global.properties=/opt/azkaban/azkaban-exec-server/conf/global.properties
azkaban.jobtype.plugin.dir=/opt/azkaban/azkaban-exec-server/plugins/jobtypes
mysql.host=bigdata005
mysql.user=root
mysql.password=Root_123
添加内容如下:
memCheck.enabled=false
azkaban.native.lib=false
[root@bigdata001 azkaban-exec-server]#
[root@bigdata001 azkaban-exec-server]# rm lib/mysql-connector-java-5.1.28.jar -f
[root@bigdata001 azkaban-exec-server]#
[root@bigdata001 azkaban-exec-server]# cd lib
[root@bigdata001 lib]#
[root@bigdata001 lib]# wget https://repo1.maven.org/maven2/mysql/mysql-connector-java/8.0.25/mysql-connector-java-8.0.25.jar
[root@bigdata001 lib]#
[root@bigdata001 bin]#
[root@bigdata001 bin]# sh start-exec.sh
[root@bigdata001 bin]#
[root@bigdata001 bin]# curl -G "localhost:$(<./executor.port)/executor?action=activate" && echo
{"status":"success"}
[root@bigdata001 bin]#
[root@bigdata001 opt]#
[root@bigdata001 opt]# cp -r /opt/azkaban-3.90.0/azkaban-web-server/build/install/azkaban-web-server azkaban/
[root@bigdata001 opt]#
[root@bigdata001 opt]# cd azkaban
[root@bigdata001 azkaban]#
[root@bigdata001 azkaban]# ls
azkaban-exec-server azkaban-web-server
[root@bigdata001 azkaban]#
[root@bigdata001 azkaban]# cd azkaban-web-server/
[root@bigdata001 azkaban-web-server]#
[root@bigdata001 azkaban-web-server]# ls
bin conf lib web
[root@bigdata001 azkaban-web-server]#
[root@bigdata001 azkaban]#
[root@bigdata001 azkaban]# keytool -keystore keystore -alias jetty -genkey -keyalg RSA
输入密钥库口令:
再次输入新口令:
您的名字与姓氏是什么?
[Unknown]:
您的组织单位名称是什么?
[Unknown]:
您的组织名称是什么?
[Unknown]:
您所在的城市或区域名称是什么?
[Unknown]:
您所在的省/市/自治区名称是什么?
[Unknown]:
该单位的双字母国家/地区代码是什么?
[Unknown]:
CN=Unknown, OU=Unknown, O=Unknown, L=Unknown, ST=Unknown, C=Unknown是否正确?
[否]: y
输入 的密钥口令
(如果和密钥库口令相同, 按回车):
Warning:
JKS 密钥库使用专用格式。建议使用 "keytool -importkeystore -srckeystore keystore -destkeystore keystore -deststoretype pkcs12" 迁移到行业标准格式 PKCS12。
[root@bigdata001 azkaban]#
[root@bigdata001 azkaban]# ls
azkaban-exec-server azkaban-web-server keystore
[root@bigdata001 azkaban]#
hehuan
修改内容如下:
azkaban.name=Azkaban
azkaban.label=My Azkaban
web.resource.dir=/opt/azkaban/azkaban-web-server/web/
default.timezone.id=Asia/Shanghai
user.manager.xml.file=/opt/azkaban/azkaban-web-server/conf/azkaban-users.xml
executor.global.properties=/opt/azkaban/azkaban-web-server/conf/global.properties
jetty.use.ssl=true
jetty.ssl.port=8443
jetty.keystore=/opt/azkaban/keystore
jetty.password=hehuan
jetty.keypassword=hehuan
jetty.truststore=/opt/azkaban/keystore
jetty.trustpassword=hehuan
[email protected]
mail.host=smtp.qq.com
[email protected]
mail.password=xxxxxx
mail.tls=true
mail.port=465
mysql.host=bigdata005
mysql.user=root
mysql.password=Root_123
azkaban.executorselector.filters=StaticRemainingFlowSize,CpuStatus # 删除MinimumFreeMemory, 避免内存检测
注意这里的mail.password不是QQ邮箱的登录密码,而是SSL邮件发送服务的SMTP服务的授权码,通过下图方式进行获取
[root@bigdata001 azkaban-web-server]#
[root@bigdata001 azkaban-web-server]# rm lib/mysql-connector-java-5.1.28.jar -f
[root@bigdata001 azkaban-web-server]#
[root@bigdata001 azkaban-web-server]# cd lib/
[root@bigdata001 lib]#
[root@bigdata001 lib]# wget https://repo1.maven.org/maven2/mysql/mysql-connector-java/8.0.25/mysql-connector-java-8.0.25.jar
[root@bigdata001 lib]#
当Azkaban的Flow执行完,发送邮件的时候报如下错误:
javax.mail.MessagingException: Could not connect to SMTP host: smtp.qq.com, port: 465;
nested exception is:
javax.net.ssl.SSLHandshakeException: No appropriate protocol (protocol is disabled or cipher suites are inappropriate)
原因是java各个版本存在差异,我的java版本为jdk1.8.0_291,该版本将TLSv1安全算法给关闭了,所有需要我们手动开启
开启方法为:修改$JAVA_HOME/jre/lib/security的java.security文件,修改前建议备份该文件,待修改内容如下:
......省略部分......
# Example:
# jdk.tls.disabledAlgorithms=MD5, SSLv3, DSA, RSA keySize < 2048
jdk.tls.disabledAlgorithms=SSLv3, TLSv1, TLSv1.1, RC4, DES, MD5withRSA, \
DH keySize < 1024, EC keySize < 224, 3DES_EDE_CBC, anon, NULL, \
include jdk.disabled.namedCurves
......省略部分......
将jdk.tls.disabledAlgorithms的TLSv1删除掉,这样就开启了TLSv1安全算法,如果不行的话,可以尝试删除SSLv3和TLSv1.1这两个
[root@bigdata001 bin]#
[root@bigdata001 bin]# sh start-web.sh
[root@bigdata001 bin]#