mapreduce任务依然可以使用azkaban进行调度
1、准备数据
[alex@hadoop102 hadoop-2.7.2]$ touch student.txt
[alex@hadoop102 hadoop-2.7.2]$ vim student.txt
1001 小明
1002 xiaohong
1003 xiaogang xiaogang xiaogang
2、上传数据到HDFS
[alex@hadoop102 hadoop-2.7.2]$ bin/hadoop fs -put student.txt /
3、查看数据
[alex@hadoop102 hadoop-2.7.2]$ bin/hadoop fs -ls /
4、编写job
[alex@hadoop102 ~]$ cd /opt/module/azkaban/jobs
[alex@hadoop102 jobs]$ vim mapreduce.job
#mapreduce job
type=command
command=/opt/module/hadoop-2.7.2/bin/hadoop jar /opt/module/hadoop-2.7.2/share/hadoop/mapreduce/hadoop-mapreduce-examples-2.7.2.jar wordcount /student.txt /wcoutput
5、将job资源文件打到一个zip包中
[alex@hadoop102 jobs]$ zip mapreduce.zip mapreduce.job
adding: mapreduce.job (deflated 43%)
6、Azkaban 执行
步骤和单Job案例 一样
在azkaban的web管理界面创建工程并上传zip包, 启动job
7、Success
8、查看
[alex@hadoop102 ~]$ cd /opt/module/hadoop-2.7.2
[alex@hadoop102 hadoop-2.7.2]$ bin/hadoop fs -cat /wcoutput/*
网友评论