图解:
[xiaoxq@hadoop105 azkaban]$ pwd
/opt/software/azkaban
[xiaoxq@hadoop105 azkaban]$ ll
总用量 35572
-rw-rw-r--. 1 xiaoxq xiaoxq 6433 8月 12 12:37 azkaban-db-3.84.4.tar.gz
-rw-rw-r--. 1 xiaoxq xiaoxq 16175002 8月 12 12:37 azkaban-exec-server-3.84.4.tar.gz
-rw-rw-r--. 1 xiaoxq xiaoxq 20239974 8月 12 12:37 azkaban-web-server-3.84.4.tar.gz
[xiaoxq@hadoop105 azkaban]$ mkdir -p /opt/module/azkaban
[xiaoxq@hadoop105 azkaban]$ pwd
/opt/software/azkaban
[xiaoxq@hadoop105 azkaban]$ tar -zxvf azkaban-db-3.84.4.tar.gz -C /opt/module/azkaban/
[xiaoxq@hadoop105 azkaban]$ tar -zxvf azkaban-exec-server-3.84.4.tar.gz -C /opt/module/azkaban/
[xiaoxq@hadoop105 azkaban]$ tar -zxvf azkaban-web-server-3.84.4.tar.gz -C /opt/module/azkaban/
[xiaoxq@hadoop105 azkaban]$ pwd
/opt/module/azkaban
[xiaoxq@hadoop105 azkaban]$ mv azkaban-exec-server-3.84.4/ azkaban-exec
[xiaoxq@hadoop105 azkaban]$ mv azkaban-web-server-3.84.4/ azkaban-web
[xiaoxq@hadoop105 azkaban]$ ll
总用量 12
drwxr-xr-x. 2 xiaoxq xiaoxq 4096 4月 18 17:24 azkaban-db-3.84.4
drwxr-xr-x. 6 xiaoxq xiaoxq 4096 4月 18 17:26 azkaban-exec
drwxr-xr-x. 6 xiaoxq xiaoxq 4096 4月 18 17:26 azkaban-web
[xiaoxq@hadoop105 azkaban]$ mysql -uroot -p密码
mysql> create database azkaban;
4)创建azkaban用户并赋予权限
有些版本需要设置以下内容:
设置密码有效长度4位及以上
mysql> set global validate_password_length=4;
设置密码策略最低级别
mysql> set global validate_password_policy=0;
mysql> CREATE USER 'azkaban'@'%' IDENTIFIED BY '123456';
mysql> GRANT SELECT,INSERT,UPDATE,DELETE ON azkaban.* to 'azkaban'@'%' WITH GRANT OPTION;
mysql> use azkaban;
mysql> source /opt/module/azkaban/azkaban-db-3.84.4/create-all-sql-3.84.4.sql;
mysql> quit;
[xiaoxq@hadoop105 software]$ sudo vim /etc/my.cnf
[mysqld]
max_allowed_packet=1024M
[xiaoxq@hadoop105 software]$ sudo systemctl restart mysqld
1)编辑 azkaban.properties
[xiaoxq@hadoop105 azkaban]$ vim /opt/module/azkaban/azkaban-exec/conf/azkaban.properties
5#...
default.timezone.id=Asia/Shanghai
#...
azkaban.webserver.url=http://hadoop105:8081
executor.port=12321
#...
database.type=mysql
mysql.port=3306
mysql.host=hadoop105
mysql.database=azkaban
mysql.user=azkaban
mysql.password=123456
mysql.numconnections=100
executor.metric.reports=true
executor.metric.milisecinterval.default=60000
2)编辑 commonprivate.properties
[xiaoxq@hadoop105 azkaban]$ vim /opt/module/azkaban/azkaban-exec/plugins/jobtypes/commonprivate.properties
azkaban.native.lib=false
azkaban.utils.UndefinedPropertyException: Missing required property 'azkaban.native.lib'
at azkaban.utils.Props.getString(Props.java:450)
at azkaban.jobExecutor.ProcessJob.run(ProcessJob.java:242)
at azkaban.execapp.JobRunner.runJob(JobRunner.java:823)
at azkaban.execapp.JobRunner.doRun(JobRunner.java:602)
at azkaban.execapp.JobRunner.run(JobRunner.java:563)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
3)同步azkaban-exec到所有节点
[xiaoxq@hadoop105 azkaban]$ xsync /opt/module/azkaban/azkaban-exec
4)必须进入到/opt/module/azkaban/azkaban-exec路径,分别在三台机器上,启动executor server
[xiaoxq@hadoop105 azkaban-exec]$ bin/start-exec.sh
[xiaoxq@hadoop106 azkaban-exec]$ bin/start-exec.sh
[xiaoxq@hadoop107 azkaban-exec]$ bin/start-exec.sh
注意:如果在 /opt/module/azkaban/azkaban-exec 目录下出现 executor.port 文件,说明启动成功
4)下面激活 executor,需要
[xiaoxq@hadoop105 azkaban-exec]$ curl -G "hadoop105:$(<./executor.port)/executor?action=activate" && echo
{
"status":"success"}
[xiaoxq@hadoop106 azkaban-exec]$ curl -G "hadoop106:$(<./executor.port)/executor?action=activate" && echo
{
"status":"success"}
[xiaoxq@hadoop107 azkaban-exec]$ curl -G "hadoop107:$(<./executor.port)/executor?action=activate" && echo
{
"status":"success"}
{
"status":"success"}
1)编辑azkaban.properties
[xiaoxq@hadoop105 azkaban]$ vim /opt/module/azkaban/azkaban-web/conf/azkaban.properties
...
default.timezone.id=Asia/Shanghai
...
database.type=mysql
mysql.port=3306
mysql.host=hadoop105
mysql.database=azkaban
mysql.user=azkaban
mysql.password=123456
mysql.numconnections=100
...
azkaban.executorselector.filters=StaticRemainingFlowSize,CpuStatus
说明:
2)修改 azkaban-users.xml 文件,添加 xiaoxq 用户
[xiaoxq@hadoop105 azkaban-web]$ vim /opt/module/azkaban/azkaban-web/conf/azkaban-users.xml
<azkaban-users>
<user groups="azkaban" password="azkaban" roles="admin" username="azkaban"/>
<user password="metrics" roles="metrics" username="metrics"/>
<user password="xiaoxq" roles="metrics,admin" username="xiaoxq"/>
<role name="admin" permissions="ADMIN"/>
<role name="metrics" permissions="METRICS"/>
azkaban-users>
3)必须进入到 hadoop105 的 /opt/module/azkaban/azkaban-web 路径,启动 web server
[xiaoxq@hadoop105 azkaban-web]$ bin/start-web.sh
4)访问http://hadoop105:8081,并用xiaoxq用户登陆