本文分享自华为云社区《开源工作流引擎Azkaban在MRS中的实践》,作者:啊喔YeYe。
实践版本:Apache azkaban 4.0.0 (以单机版举例,集群版本配置
过程类似),MRS 3.1.0 普通集群。
Azkaban 插件地址
Azkaban 官网
Azkaban 源码地址
Azkaban不提供二进制包,需要用户下载源码编译打包,获取到“azkaban-solo-server.zip”和“azkaban-db.zip”。
unzip azkaban-solo-server.zip
rm -f unzip azkaban-solo-server.zip
jetty.port=8081
database.type=mysql
mysql.port=3306
mysql.host=x.x.x.x
mysql.database=azkaban
mysql.user=xxx
mysql.password=xxx
source /opt/client/bigdata_env
cd /opt/azkaban/azkaban-solo-server
sh bin/start-solo.sh
说明
默认端口(port):8081;
用户名/密码:azkaban/azkaban;
用户账号配置文件: /opt/azkaban/azkaban-solo-server/conf/azkaban-users.xml
连接HDFS需要用户下载源码编译获取“az-hdfs-viewer.zip”,并已完成安装azkaban-solo-server。
unzip az-hdfs-viewer.zip
rm -f az-hdfs-viewer.zip
mv az-hdfs-viewer hdfs
viewer.name=HDFS
viewer.path=hdfs
viewer.order=1
viewer.hidden=false
viewer.external.classpaths=extlib/*
viewer.servlet.class=azkaban.viewer.hdfs.HdfsBrowserServlet
hadoop.security.manager.class=azkaban.security.HadoopSecurityManager_H_2_0
azkaban.should.proxy=false
proxy.user=azkaban // mrs集群中配置的azkaban代理用户名
allow.group.proxy=true
file.max.lines=1000
#Specifying the error message we want user to get when they don't have permissionsviewer.access_denied_message=The folder you are trying to access is protected.
execute.as.user=false
// execute-as-user存放目录
azkaban.native.lib=/opt/azkaban/azkaban-solo-server
若不存在该文件需手动创建并配置以上内容
cp /opt/client/HDFS/hadoop/share/hadoop/hdfs/*.jar /opt/azkaban/azkaban-solo-server/extlib
cp /opt/client/HDFS/hadoop/share/hadoop/client/hadoop-client-api-3.1.1-mrs-2.0.jar /opt/azkaban/azkaban-solo-server/extlib
cp /opt/client/HDFS/hadoop/share/hadoop/common/*.jar /opt/azkaban/azkaban-solo-server/extlib
不同MRS版本所需Hadoop相关版本不同,通过find /opt/client查询目
- azkaban-solo-server
- bin
- conf
- extlib (hadoop相关插件第三方包)
- lib
- logs
- plugins
- jobtypes(job插件目录)
- commonprivate.properties
- hive
- plugin.properties
- private.properties
- hadoopJava
- plugin.properties
- private.properties
- viewer
- hdfs
- conf
- plugin.properties
- lib (az-hdfs-viewer.zip解压后的lib)
- temp
- web
cd /opt/azkaban/azkaban-solo-server
sh bin/shutdown-solo.sh
sh bin/start-solo.sh
安装azkaban-solo-server完成后,再部署验证hadoop-job
# set execute-as-user
execute.as.user=false
hadoop.security.manager.class=azkaban.security.HadoopSecurityManager_H_2_0
azkaban.should.proxy=false
obtain.binary.token=false
proxy.user=azkaban // MRS集群中配置的Azkaban代理用户名
allow.group.proxy=true
// execute-as-user存放目录
azkaban.native.lib=/opt/azkaban/azkaban-solo-server
# hadoop
hadoop.home=/opt/client/HDFS/hadoop //opt/client为MRS集群客户端安装目录
hive.home=/opt/client/Hive/Beeline
spark.home=/opt/client/Spark/spark
hadoop.classpath=${hadoop.home}/etc/hadoop,${hadoop.home}/share/hadoop/common/*,${hadoop.home}/share/hadoop/common/lib/*,${hadoop.home}/share/hadoop/hdfs/*,${hadoop.home}/share/hadoop/hdfs/lib/*,${hadoop.home}/share/hadoop/yarn/*,${hadoop.home}/share/hadoop/yarn/lib/*,${hadoop.home}/share/hadoop/mapreduce/*,${hadoop.home}/share/hadoop/mapreduce/lib/*
jobtype.global.classpath=${hadoop.home}/etc/hadoop,${hadoop.home}/share/hadoop/common/*,${hadoop.home}/share/hadoop/common/lib/*,${hadoop.home}/share/hadoop/hdfs/*,${hadoop.home}/share/hadoop/hdfs/lib/*,${hadoop.home}/share/hadoop/yarn/*,${hadoop.home}/share/hadoop/yarn/lib/*,${hadoop.home}/share/hadoop/mapreduce/*,${hadoop.home}/share/hadoop/mapreduce/lib/*
Ross male 33 3674
Julie male 42 2019
Gloria female 45 3567
Carol female 36 2813
cd /opt/client
source bigdata_env
hdfs dfs -put /opt/input.txt /tmp/azkaban_test
type=hadoopJava
job.extend=false
job.class=azkaban.jobtype.examples.java.WordCount
classpath=./lib/*,/opt/azkaban-solo-server-0.1.0-SNAPSHOT/lib/*
force.output.overwrite=true
input.path=/tmp/azkaban_test
output.path=/tmp/azkaban_test_out
spark任务有两种运行方式,一种是command方式,另一种是spark jobtype方式。
/opt/client/Spark/spark/
版权说明 : 本文为转载文章, 版权归原作者所有 版权申明
原文链接 : https://huaweicloud.blog.csdn.net/article/details/124836812
内容来源于网络,如有侵权,请联系作者删除!