当前位置:   article > 正文

azkaban多节点部署安装记录_executorserverlog__2024-01-09+14:53:11.out

executorserverlog__2024-01-09+14:53:11.out

环境准备

jdk8+

mysql

节点划分

centosx1centosx2centosx3
web-server
exe-serverexe-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
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6

部署步骤

构建编译

​ 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文件
  • 1
  • 2
  • 3

理论上启动什么服务就拷贝什么文件,一起拷贝以后切换节点方便。

把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
......
  • 1
  • 2
  • 3
  • 4

进入数据库

# 建立库
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
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
配置web-server

编辑配置文件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
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55

检查 用户账号文件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>
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
配置exe-server

编辑配置文件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
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
复制到其他节点
[root@centos7x1 local]# scp /usr/local/azkaban/ root@centos7x2:/usr/local
[root@centos7x1 local]# scp /usr/local/azkaban/ root@centos7x3:/usr/local
  • 1
  • 2
启动系统

原则是先启动exe再启动web

启动exe-server节点

先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
  • 1
  • 2
  • 3
  • 4
激活exe节点

进入到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)
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
启动web-server节点

同样先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]# 
  • 1
  • 2
  • 3
  • 4
  • 5

成功后访问http://172.16.79.101:8081/

一些问题

解决executor不激活问题

有时候 启动的时候报这个错误,节点不自动激活,此时需要手动激活一下。

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
  • 1
  • 2

手动激活 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)
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
curl http://${executorHost}:${executorPort}/executor?action=activate
  • 1
zang@zang-MS-7A15:~$ curl http://172.16.79.103:37454/executor?action=activate
{"status":"success"}
  • 1
  • 2
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/你好赵伟/article/detail/79824
推荐阅读
相关标签
  

闽ICP备14008679号