当前位置:网站首页>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操作
边栏推荐
- How to find hot projects in 2022? Dena community project progress follow-up, there is always a dish for you (1)
- Good documentation
- 丸子百度小程序详细配置教程,审核通过。
- 8. Commodity management - commodity classification
- 平台入驻与独立部署优缺点对比
- [機緣參悟-38]:鬼穀子-第五飛箝篇 - 警示之一:有一種殺稱為“捧殺”
- Android advanced interview question record in 2022
- 【LeetCode】222. The number of nodes of a complete binary tree (2 mistakes)
- Zabbix
- Matrixone 0.2.0 is released, and the fastest SQL computing engine is coming
猜你喜欢
The perfect car for successful people: BMW X7! Superior performance, excellent comfort and safety
Chinese natural language processing, medical, legal and other public data sets, sorting and sharing
Design of kindergarten real-time monitoring and control system
Naacl 2021 | contrastive learning sweeping text clustering task
Exploration of short text analysis in the field of medical and health (II)
The perfect car for successful people: BMW X7! Superior performance, excellent comfort and safety
Hmi-32- [motion mode] add light panel and basic information column
丸子百度小程序详细配置教程,审核通过。
openresty ngx_ Lua execution phase
[uc/os-iii] chapter 1.2.3.4 understanding RTOS
随机推荐
Returns the lowest common ancestor of two nodes in a binary tree
openresty ngx_lua变量操作
Video display and hiding of imitation tudou.com
[download white paper] does your customer relationship management (CRM) really "manage" customers?
Subject 3 how to turn on the high beam diagram? Is the high beam of section 3 up or down
The perfect car for successful people: BMW X7! Superior performance, excellent comfort and safety
Process scheduling and termination
2022/02/13
【附源码】基于知识图谱的智能推荐系统-Sylvie小兔
TCP security of network security foundation
Application and Optimization Practice of redis in vivo push platform
【LeetCode】501. Mode in binary search tree (2 wrong questions)
Redis distributed lock, lock code logic
Scientific research: are women better than men?
【LeetCode】98. Verify the binary search tree (2 brushes of wrong questions)
Vb+access hotel service management system
Using druid to connect to MySQL database reports the wrong type
February database ranking: how long can Oracle remain the first?
Go RPC call
Variables in postman