jdk8+
mysql
centosx1 | centosx2 | centosx3 |
---|---|---|
web-server | ||
exe-server | exe-server | |
mysql |
这里编辑了hosts文件,关闭了selinux和firewalld
[root@centos7x3 azkaban-exec-server]# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
172.16.79.101 centos7x1
172.16.79.102 centos7x2
172.16.79.103 centos7x3
gradle又臭又长,暂时省略
获得需要的三个文件夹
azkaban-db-3.84.4.tar.gz #数据库文件
azkaban-web-server-3.84.4.tar.gz #web-server文件
azkaban-exec-server-3.84.4.tar.gz #exe-server文件
理论上启动什么服务就拷贝什么文件,一起拷贝以后切换节点方便。
把azkaban-web-server-3.84.4.tar.gz 解压重命名到/user/local/azkaban/azkaban-web-server
把azkaban-exec-server-3.84.4.tar.gz 解压重命名到/user/lobal/azkaban/azkaban-exec-server
解压azkaban-db-3.84.4.tar.gz,得到其中的create-all-sql-3.84.4.sql
[root@centos7x1 azkaban-db-3.84.4]# ls
......
create-all-sql-3.84.4.sql
......
进入数据库
# 建立库
mysql> create database azkaban default character set utf8mb4;
# 建立账号
mysql> grant all privileges on azkaban.* to 'azkaban'@'%' identified by 'azkaban';
mysql> flush privileges;
mysql> exit;
[root@centos7x1 azkaban-db-3.84.4]# mysql -uazkaban -p azkaban < create-all-sql-3.84.4.sql
编辑配置文件azkaban-web-server/conf/azkaban.properties
# Azkaban Personalization Settings
azkaban.name=Test
azkaban.label=My Local Azkaban
azkaban.color=#FF3601
azkaban.default.servlet.path=/index
web.resource.dir=/usr/local/azkaban/azkaban-web-server/web
default.timezone.id=Asia/Shanghai
# Azkaban UserManager class
# 管理账号文件
user.manager.class=azkaban.user.XmlUserManager
user.manager.xml.file=/usr/local/azkaban/azkaban-web-server/conf/azkaban-users.xml
# Loader for projects
executor.global.properties=conf/global.properties
azkaban.project.dir=projects
# Velocity dev mode
velocity.dev.mode=false
# Azkaban Jetty server properties.
jetty.use.ssl=false
jetty.maxThreads=25
jetty.port=8081
# Azkaban Executor settings
# mail settings
mail.sender=
mail.host=
# User facing web server configurations used to construct the user facing server URLs. They are useful when there is a reverse proxy between Azkaban web servers and users.
# enduser -> myazkabanhost:443 -> proxy -> localhost:8081
# when this parameters set then these parameters are used to generate email links.
# if these parameters are not set then jetty.hostname, and jetty.port(if ssl configured jetty.ssl.port) are used.
# azkaban.webserver.external_hostname=myazkabanhost.com
# azkaban.webserver.external_ssl_port=443
# azkaban.webserver.external_port=8081
job.failure.email=
job.success.email=
lockdown.create.projects=false
cache.directory=cache
# JMX stats
jetty.connector.stats=true
executor.connector.stats=true
# Azkaban mysql settings by default. Users should configure their own username and password.
database.type=mysql
mysql.port=3306
mysql.host=centos7x1
mysql.database=azkaban
mysql.user=azkaban
mysql.password=azkaban
mysql.numconnections=100
#Multiple Executor
azkaban.use.multiple.executors=true
#MinimumFreeMemory只会选择内存大于6G的节点,所以去掉该策略
#azkaban.executorselector.filters=StaticRemainingFlowSize,MinimumFreeMemory,CpuStatus
azkaban.executorselector.filters=StaticRemainingFlowSize,CpuStatus
azkaban.executorselector.comparator.NumberOfAssignedFlowComparator=1
azkaban.executorselector.comparator.Memory=1
azkaban.executorselector.comparator.LastDispatched=1
azkaban.executorselector.comparator.CpuUsage=1
检查 用户账号文件vim azkaban-web-server/conf/azkaban-users.xml
<azkaban-users>
<user groups="azkaban" password="azkaban" roles="admin" username="azkaban"/>
<user password="metrics" roles="metrics" username="metrics"/>
<role name="admin" permissions="ADMIN"/>
<role name="metrics" permissions="METRICS"/>
azkaban-users>
编辑配置文件azkaban-exec-server/conf/azkaban.properties ,与web-server大体是一样的,只是web-server多了选择exe节点的相关配置
# Azkaban Personalization Settings
azkaban.name=Test
azkaban.label=My Local Azkaban
azkaban.color=#FF3601
azkaban.default.servlet.path=/index
web.resource.dir=/usr/local/azkaban/azkaban-web-server/web
default.timezone.id=Asia/Shanghai
# Azkaban UserManager class
user.manager.class=azkaban.user.XmlUserManager
user.manager.xml.file=/usr/local/azkaban/azkaban-web-server/conf/azkaban-users.xml
# Loader for projects
executor.global.properties=conf/global.properties
azkaban.project.dir=projects
# Velocity dev mode
velocity.dev.mode=false
# Azkaban Jetty server properties.
jetty.use.ssl=false
jetty.maxThreads=25
jetty.port=8081
# Where the Azkaban web server is located
azkaban.webserver.url=http://localhost:8081
# mail settings
mail.sender=
mail.host=
# User facing web server configurations used to construct the user facing server URLs. They are useful when there is a reverse proxy between Azkaban web servers and users.
# enduser -> myazkabanhost:443 -> proxy -> localhost:8081
# when this parameters set then these parameters are used to generate email links.
# if these parameters are not set then jetty.hostname, and jetty.port(if ssl configured jetty.ssl.port) are used.
# azkaban.webserver.external_hostname=myazkabanhost.com
# azkaban.webserver.external_ssl_port=443
# azkaban.webserver.external_port=8081
job.failure.email=
job.success.email=
lockdown.create.projects=false
cache.directory=cache
# JMX stats
jetty.connector.stats=true
executor.connector.stats=true
# Azkaban plugin settings
azkaban.jobtype.plugin.dir=plugins/jobtypes
# Azkaban mysql settings by default. Users should configure their own username and password.
database.type=mysql
mysql.port=3306
mysql.host=centos7x1
mysql.database=azkaban
mysql.user=azkaban
mysql.password=azkaban
mysql.numconnections=100
# Azkaban Executor settings
executor.maxThreads=50
executor.flow.threads=30
[root@centos7x1 local]# scp /usr/local/azkaban/ root@centos7x2:/usr/local
[root@centos7x1 local]# scp /usr/local/azkaban/ root@centos7x3:/usr/local
原则是先启动exe再启动web
先cd到目录里,在start,因为系统会在当前目录创建几个文件(端口和日志等)
[root@centos7x2 azkaban-exec-server]# cd /usr/local/azkaban/azkaban-exec-server/
[root@centos7x2 azkaban-exec-server]# bin/start-exec.sh
[root@centos7x2 azkaban-exec-server]# ls
bin conf currentpid executions executor.port executorServerLog__2020-06-27+14:27:02.out lib logs plugins projects temp
进入到mysql,可以看到有两个节点进行了注册,修改actvie=0为1,激活节点
mysql> select * from executors;
+----+-----------+-------+--------+
| id | host | port | active |
+----+-----------+-------+--------+
| 4 | centos7x3 | 37454 | 0 |
| 5 | centos7x2 | 38088 | 0 |
+----+-----------+-------+--------+
2 rows in set (0.04 sec)
mysql> update executors set active=1;
Query OK, 2 rows affected (0.00 sec)
Rows matched: 2 Changed: 2 Warnings: 0
mysql> select * from executors;
+----+-----------+-------+--------+
| id | host | port | active |
+----+-----------+-------+--------+
| 4 | centos7x3 | 37454 | 1 |
| 5 | centos7x2 | 38088 | 1 |
+----+-----------+-------+--------+
2 rows in set (0.02 sec)
同样先cd到目录,在运行start-web.sh
[root@centos7x1 azkaban-exec-server]# cd /usr/local/azkaban/azkaban-web-server/
[root@centos7x1 azkaban-web-server]# bin/start-web.sh
[root@centos7x1 azkaban-web-server]# ls
bin conf currentpid lib logs temp web webServerLog_2020-06-27+14:27:53.out
[root@centos7x1 azkaban-web-server]#
成功后访问http://172.16.79.101:8081/
有时候 启动的时候报这个错误,节点不自动激活,此时需要手动激活一下。
2020/06/27 14:51:56.580 +0800 ERROR [ExecutorServlet] [Azkaban] executor became inactive before setting up the flow 24
azkaban.executor.ExecutorManagerException: executor became inactive before setting up the flow 24
手动激活 Executor方法:
端口号可以在executor.port中查看,或者在数据库中executors表中。
mysql> select * from executors;
+----+-----------+-------+--------+
| id | host | port | active |
+----+-----------+-------+--------+
| 4 | centos7x3 | 37454 | 1 |
| 5 | centos7x2 | 38088 | 1 |
+----+-----------+-------+--------+
2 rows in set (0.02 sec)
curl http://${executorHost}:${executorPort}/executor?action=activate
zang@zang-MS-7A15:~$ curl http://172.16.79.103:37454/executor?action=activate
{"status":"success"}