当前位置:网站首页>Azkaban实战
Azkaban实战
2022-07-05 02:41:00 【一个正在努力的菜鸡】
单一job案例
1.创建job描述文件
- vim job1.job
#first.job
type=command
command=echo 'this is my first job'
2.将job资源文件打包成zip文件
- 安装zip,unzip命令
yum install -y unzip zip
- 压缩
zip job1.zip job1.job
- Azkaban上传的工作流文件只支持xxx.zip文件,zip应包含xxx.job运行作业所需的文件和任何文件(文件名后缀必须是.job,否则无法识别),作业名称在项目中必须是唯一的
3.通过azkaban的web管理平台创建project并上传job的zip包
- 创建project

- 上传zip包

- 启动执行该job



- Job执行成功

- 点击查看job日志

多job工作流案例
1.创建job描述文件
- 第一个job:start.job
vim start.job
#start.job
type=command
command=touch /usr/local/azkaban/jobs/t2test.txt
- 第二个job:step1.job依赖start.job
vim step1.job
#step1.job
type=command
dependencies=start
command=echo "this is step1 job"
- 第三个job:step2.job依赖start.job
vim step2.job
#step2.job
type=command
dependencies=start
command=echo "this is step2 job"
- 第四个job:finish.job依赖step1.job和step2.job
vim finish.job
#finish.job
type=command
dependencies=step1,step2
command=echo "this is finish job"
2.将job资源文件打包成zip文件
- zip jobs.zip start.job step1.job step2.job finish.job
3.通过azkaban的web管理平台创建project并上传job的zip包


Java操作任务
1.编写java程序
import java.io.FileOutputStream;
import java.io.IOException;
public class AzkabanTest {
public void run() throws IOException {
FileOutputStream fos = new FileOutputStream("/usr/local/azkaban/t3test.txt");
fos.write("this is a java progress".getBytes());
fos.close();
}
public static void main(String[] args) throws IOException {
AzkabanTest azkabanTest = new AzkabanTest();
azkabanTest.run();
}
}
2.java程序打成jar
- 生成class文件

- jar -cvf AzkabanTest.jar AzkabanTest.class

- 移动到linux内

- 试运行
java -jar AzkabanTest.jar
3.编写job
- vim java.job
type=javaprocess
java.class=AzkabanTest
classpath=/usr/local/azkaban/jobs/t3/jar/* 4.将job打成zip
- zip java.zip java.job
5.web操作

HDFS操作任务
1.创建job描述文件
- vim fs.job
type=command
command=/usr/local/hadoop-2.7.1/bin/hadoop fs -mkdir /azkaban
2.将job资源文件打包成zip文件
zip fs.zip fs.job
3.web操作


MapReduce任务
1.创建job描述文件
- vim mapreduce.job
#mapreduce job
type=command
command=/usr/local/hadoop-2.7.1/bin/hadoop jar /usr/local/hadoop-2.7.1/share/hadoop/mapreduce/hadoop-mapreduce-examples-2.7.1.jar wordcount /wordcountinput /wordcountinputazkaban
2.将job资源文件打包成zip文件
zip mapreduce.zip mapreduce.job
3.web操作


边栏推荐
- Bert fine tuning skills experiment
- ASP. Net core 6 framework unveiling example demonstration [01]: initial programming experience
- Hmi-30- [motion mode] the module on the right side of the instrument starts to write
- Security level
- Vb+access hotel service management system
- Good documentation
- CAM Pytorch
- Open source SPL optimized report application coping endlessly
- 返回二叉树中两个节点的最低公共祖先
- TCP security of network security foundation
猜你喜欢

问题解决:AttributeError: ‘NoneType‘ object has no attribute ‘append‘
![[uc/os-iii] chapter 1.2.3.4 understanding RTOS](/img/33/1d94583a834060cc31cab36db09d6e.jpg)
[uc/os-iii] chapter 1.2.3.4 understanding RTOS

Summary and practice of knowledge map construction technology

Spoon inserts and updates the Oracle database, and some prompts are inserted with errors. Assertion botch: negative time

Design and practice of kubernetes cluster and application monitoring scheme

LeetCode 314. Binary tree vertical order traversal - Binary Tree Series Question 6

Single line function*

Missile interception -- UPC winter vacation training match

Design and implementation of kindergarten management system

2021 Li Hongyi machine learning (1): basic concepts
随机推荐
Openresty ngx Lua Execution stage
Advanced conditional statements of common SQL operations
ELK日志分析系统
Single line function*
【微服务|SCG】Filters的33种用法
[daily problem insight] Li Kou - the 280th weekly match (I really didn't know it could be so simple to solve other people's problems)
Pytorch register_ Hook (operate on gradient grad)
Unpool(nn.MaxUnpool2d)
The steering wheel can be turned for one and a half turns. Is there any difference between it and two turns
Character painting, I use characters to draw a Bing Dwen Dwen
Design and implementation of high availability website architecture
返回二叉树中两个节点的最低公共祖先
Introduce reflow & repaint, and how to optimize it?
Spoon inserts and updates the Oracle database, and some prompts are inserted with errors. Assertion botch: negative time
打破信息茧房-我主动获取信息的方法 -#3
低度酒赛道进入洗牌期,新品牌如何破局三大难题?
Process scheduling and termination
Uniapp navigateto jump failure
Marubeni Baidu applet detailed configuration tutorial, approved.
Returns the lowest common ancestor of two nodes in a binary tree