Oozie 实战之 shell
说明:使用 shell action 执行 shell 脚本 hive-select-test.sh 来通过已经配置好的 Hive -f 来执行 HQL 查询脚本文件 select.sql
1.创建脚本文件 hive-select-test.sh
#!/bin/sh
/opt/cdh5.3.6/hive-1.1.0-cdh5.12.0/bin/hive -f select.sql
2.创建 HQL 文件 select.sql
insert overwrite directory '/user/cen/oozie-apps/shell-hive-select/output/' select count(1) cnt from default.test;
3.修改 job.properties 文件
nameNode=hdfs://cen-ubuntu.cenzhongman.com:8020
jobTracker=localhost:8032
queueName=default
oozieAppsRoot=oozie-apps
oozie.wf.application.path=${nameNode}/user/cen/${oozieAppsRoot}/shell-hive-select/
EXEC=hive-select-test.sh
script=select.sql
4.修改 workflow.xml 文件
<workflow-app xmlns="uri:oozie:workflow:0.5" name="shell-wf">
<start to="shell-node"/>
<action name="shell-node">
<shell xmlns="uri:oozie:shell-action:0.2">
<job-tracker>${jobTracker}</job-tracker>
<name-node>${nameNode}</name-node>
<configuration>
<property>
<name>mapred.job.queue.name</name>
<value>${queueName}</value>
</property>
</configuration>
<exec>${EXEC}</exec>
<file>${nameNode}/user/cen/${oozieAppsRoot}/shell-hive-select/${EXEC}#${EXEC}</file>
<file>${nameNode}/user/cen/${oozieAppsRoot}/shell-hive-select/${script}#${script}</file>
</shell>
<ok to="end"/>
<error to="fail"/>
</action>
<kill name="fail">
<message>Shell action failed, error message[${wf:errorMessage(wf:lastErrorNode())}]</message>
</kill>
<end name="end"/>
</workflow-app>
注意事项
- workflow 版本0,5 sqoop action 版本0.2
- 使用的是新版本的API,但旧版本依旧支持使用(可以不用改)
- 关于file作用和配置,下文会说明
5.上传文件到HDFS文件系统
6.执行程序
export OOZIE_URL=http://cen-ubuntu:11000/oozie/
bin/oozie job --config oozie-apps/shell-hive-select/job.properties -run
Oozie 实战之 shell的更多相关文章
- Hadoop生态圈-Oozie实战之调度shell脚本
Hadoop生态圈-Oozie实战之调度shell脚本 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 本篇博客展示案例:使用Oozie调度Shell脚本. 1>.解压官方案例 ...
- Hadoop生态圈-Oozie实战之逻辑调度执行多个Job
Hadoop生态圈-Oozie实战之逻辑调度执行多个Job 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 1>.启动hadoop集群 [root@yinzhengjie ha ...
- 【原创】大叔经验分享(48)oozie中通过shell执行impala
oozie中通过shell执行impala,脚本如下: $ cat test_impala.sh #!/bin/sh /usr/bin/kinit -kt /tmp/impala.keytab imp ...
- HUE通过oozie工作流执行shell脚本
HUE通过oozie工作流执行shell脚本 2018年01月17日 16:20:38 阅读数:217 首先上传对应的jar包和storm.sh脚本到hdfs,脚本内容如下: 脚本主要内容是:从hdf ...
- shell编程系列22--shell操作数据库实战之shell脚本与MySQL数据库交互(增删改查)
shell编程系列22--shell操作数据库实战之shell脚本与MySQL数据库交互(增删改查) Shell脚本与MySQL数据库交互(增删改查) # 环境准备:安装mariadb 数据库 [ro ...
- Spark实战1:shell+独立App使用总结
Spark改进了Hadoop执行非流式算法的需要多次IO的缺陷,Spark的所有操作都是基于RDD弹性分布式数据集这种数据结构的,对RDD的操作主要的操作包括transform和action两种操作. ...
- Oozie 实战之 Hive
1.编辑job.propertiers nameNode=hdfs://cen-ubuntu.cenzhongman.com:8020 jobTracker=localhost:8032 queueN ...
- oozie调用shell
<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agree ...
- 2-10 就业课(2.0)-oozie:4、通过oozie执行shell脚本
oozie的配置文件job.properties:里面主要定义的是一些key,value对,定义了一些变量,这些变量往workflow.xml里面传递workflow.xml :workflow的配置 ...
随机推荐
- node-sass 安装报错解决办法
npm install安装node-sass时出现以下问题: Cannot download https://github.com/sass/node-sass/releases/download/v ...
- 使用Ribbon Workbench来修改停用、激活按钮的权限
在实施的过程中,有时会遇到客户为了管控使用人员的操作或防止使用人员通过停用后再激活来绕开部分逻辑,需要对激活.停用按钮赋予单独的权限.但很遗憾,在Dyanmics CRM中,并没有把停用.激活按钮单独 ...
- Visual Studio Code 入门教程
Extensible and customizable.(可扩展的和可定制的,这是我喜欢它的原因) Want even more features? Install extensions to add ...
- Java Knowledge series 2
JVM Analysis & Design The object-oriented paradigm is a new and different way of thingking about ...
- 《ArcGIS Runtime SDK for Android开发笔记》——(9)、空间数据的容器-地图MapView
1.前言 在上一篇内容里介绍了 关于ArcGIS Android开发的未来(“Quartz”版Beta)相关内容,期间也提到了关于API接口的重构,开发思路的调整,根据2015UC资料也可以知道新版预 ...
- Request processing failed; nested exception is org.apache.ibatis.binding.BindingException: Invalid b
Request processing failed; nested exception is org.apache.ibatis.binding.BindingException: Invalid b ...
- TeamViewer 软件完全卸载
TeamViewer 软件似乎用于商业环境中 - 彻底卸载 Windows 1. 检测为商业用途该软件似乎用于商业环境中.请注意:免费版仅供个人使用.您的会话将在 5 分钟后终止. 2.1 Close ...
- js01
/////////////////////////////////////////////////////////////js开端/////////////////////////////////// ...
- April 5 2017 Week 14 Wednesday
Today is a perfect day to start living your dream. 实现梦想,莫如当下. Miracles may happen every day. If you ...
- Codeforces - Educational Codeforces Round 5 - E. Sum of Remainder
题目链接:http://codeforces.com/contest/616/problem/E 题目大意:给定整数n,m(1≤n,m≤1013), 求(n mod 1 + n mod 2 + ... ...