执行azkaban脚本

先启动Hadoop,hive,和 azkaban的两个进程:
打开网页:https://192.168.xx.xx:8443自己IP地址登录即可(admin:admin)

azkaban的运行执行脚本:
创建一个脚本a.job:
#command.job
type=command
command=echo "hello world
压缩为a.zip
在azkaban里面创建一个项目上传a.zip之后执行脚本变绿为正常。

然后把两个脚本压缩到一个包里;
上传azkaban执行:
创建oo.job脚本:
type=command
dependencies=ff
command= echo oo

创建ff.job的脚本:
#ff.job
type=command
command=echo ff

创建脚本:(在hdfs上创建一个input)
type=command
command=/usr/local/hadoop-2.7.3/bin/hadoop fs -mkdir /input
上传执行

用MapReduce处理数据:(需要一个jar包一起压缩上传azkaban)
创建脚本:
type=command
command=/usr/local/hadoop-2.7.3/bin/hadoop jar hadoop-mapreduce-examples-2.7.3.jar wordcount /input /output
准备jar包:(jar的位置在/usr/local/hadoop-2.7.3/share/hadoop/mapreduce)
hadoop-mapreduce-examples-2.7.3.jar
上传执行。

上传数据到hive:

创建一个脚本test.sql:
use default;
drop table aztest;
create table aztest(id int,name string) row format delimited fields terminated by ‘,’;
load data local inpath ‘/aztest/a.txt’ into table aztest;
create table azres as select * from aztest;
insert overwrite directory ‘/aztest/hiveoutput’ select count(1) from aztest;

创建一个脚本sql.job:
type=command
command=/usr/local/hive/bin/hive -f test.sql
把两个脚本压缩到一个包里上传azkaban执.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值