当前位置:网站首页>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操作


边栏推荐
- A tab Sina navigation bar
- spoon插入更新oracle数据库,插了一部分提示报错Assertion botch: negative time
- Bert fine tuning skills experiment
- Blue bridge - maximum common divisor and minimum common multiple
- openresty ngx_ Lua execution phase
- ELK日志分析系统
- February database ranking: how long can Oracle remain the first?
- Pytest (5) - assertion
- Last words record
- Subject 3 how to turn on the high beam diagram? Is the high beam of section 3 up or down
猜你喜欢

Yolov5 model training and detection

Asynchronous and promise

Elk log analysis system

Three properties that a good homomorphic encryption should satisfy

Action News
![[200 opencv routines] 99 Modified alpha mean filter](/img/df/1b7beb6746f416198fc405249852f8.jpg)
[200 opencv routines] 99 Modified alpha mean filter

Character painting, I use characters to draw a Bing Dwen Dwen

【LeetCode】111. Minimum depth of binary tree (2 brushes of wrong questions)

Design and implementation of kindergarten management system

ELFK部署
随机推荐
PHP cli getting input from user and then dumping into variable possible?
A tab Sina navigation bar
Official announcement! The third cloud native programming challenge is officially launched!
【LeetCode】404. Sum of left leaves (2 brushes of wrong questions)
Subject 3 how to turn on the high beam diagram? Is the high beam of section 3 up or down
Icu4c 70 source code download and compilation (win10, vs2022)
[机缘参悟-38]:鬼谷子-第五飞箝篇 - 警示之一:有一种杀称为“捧杀”
Design and implementation of high availability website architecture
ASP. Net core 6 framework unveiling example demonstration [01]: initial programming experience
Learn game model 3D characters, come out to find a job?
Hmi-32- [motion mode] add light panel and basic information column
Some query constructors in laravel (2)
RichView TRVStyle MainRVStyle
Kotlin - 协程 Coroutine
Visual studio 2019 set transparent background (fool teaching)
Advanced learning of MySQL -- Application -- Introduction
Design of KTV intelligent dimming system based on MCU
GFS distributed file system
The perfect car for successful people: BMW X7! Superior performance, excellent comfort and safety
Master Fur