1.13-1.14 Hive Action
一、Hive Action
1、创建文件
[root@hadoop-senior oozie-apps]# pwd
/opt/cdh-5.3.6/oozie-4.0.0-cdh5.3.6/oozie-apps [root@hadoop-senior oozie-apps]# mkdir hive-select ##job.properties
nameNode=hdfs://hadoop-senior.ibeifeng.com:8020
jobTracker=hadoop-senior.ibeifeng.com:8032
queueName=default
oozieAppsRoot=user/root/oozie-apps
oozieDataRoot=user/root/oozie/datas oozie.use.system.libpath=true oozie.wf.application.path=${nameNode}/${oozieAppsRoot}/hive-select/ outputDir=hive-select/output ##workflow.xml
<workflow-app xmlns="uri:oozie:workflow:0.5" name="wf-hive-select">
<start to="hive-node"/> <action name="hive-node">
<hive xmlns="uri:oozie:hive-action:0.5">
<job-tracker>${jobTracker}</job-tracker>
<name-node>${nameNode}</name-node>
<prepare>
<delete path="${nameNode}/${oozieDataRoot}/${outputDir}"/>
</prepare>
<job-xml>${nameNode}/${oozieAppsRoot}/hive-select/hive-site.xml</job-xml>
<configuration>
<property>
<name>mapred.job.queue.name</name>
<value>${queueName}</value>
</property>
</configuration>
<script>select-student.sql</script>
<param>OUTPUT=${nameNode}/${oozieDataRoot}/${outputDir}</param>
</hive>
<ok to="end"/>
<error to="fail"/>
</action> <kill name="fail">
<message>Hive failed, error message[${wf:errorMessage(wf:lastErrorNode())}]</message>
</kill>
<end name="end"/>
</workflow-app>
##参数注释
<job-xml>${nameNode}/${oozieAppsRoot}/hive-select/hive-site.xml</job-xml> //指定hive-site.xml文件的路径,因为运行hive action要读取hive的配置
<script>select-student.sql</script> //指定要运行的sql脚本,默认和workflow.xml在同一目录下
2、上传到hdfs
##[root@hadoop-senior hive-select]# vim select-student.sql //内容如下
insert overwrite directory '${OUTPUT}' select
count(1) cnt
from default.student ; ##
[root@hadoop-senior oozie-apps]# cp /opt/cdh-5.3.6/hive-0.13.1-cdh5.3.6/conf/hive-site.xml hive-select/ ##
[root@hadoop-senior oozie-apps]# mkdir hive-select/lib [root@hadoop-senior oozie-apps]# cp /opt/softwares/mysql-libs/mysql-connector-java-5.1.27/mysql-connector-java-5.1.27-bin.jar hive-select/lib/ ##上传到hdfs
[root@hadoop-senior oozie-apps]# /opt/cdh-5.3.6/hadoop-2.5.0-cdh5.3.6/bin/hdfs dfs -put hive-select/ /user/root/oozie-apps
3、运行oozie job
##
[root@hadoop-senior oozie-4.0.0-cdh5.3.6]# export OOZIE_URL=http://hadoop-senior.ibeifeng.com:11000/oozie/ [root@hadoop-senior oozie-4.0.0-cdh5.3.6]# bin/oozie job -config oozie-apps/hive-select/job.properties -run
1.13-1.14 Hive Action的更多相关文章
- Thinkpad W520 + Ubuntu 12.04LTS, 13.10, 14.04LTS安装Nvidia显卡驱动设置
Thinkpad W520 + Ubuntu 12.04LTS, 13.10, 14.04LTS安装Nvidia显卡驱动设置 http://henzhai.com/tech/2012/07/w520- ...
- 升级MAC OS到10.13, 10.14系统后UNITY工程无法加载资源的解决办法
升级MAC OS到10.13, 10.14系统后,出现UNITY工程无法加载资源的情况: Unity项目中Asset目录显示为空! 解决办法一: 打开Launchpad中的磁盘工具 (也就是实用工具下 ...
- JavaScript高级程序设计(第三版)学习笔记13、14章
第13章,事件 事件冒泡 IE的事件叫做事件冒泡:由具体到不具体 <!DOCTYPE html> <html> <head> <title>E ...
- [团队项目]第二个冲刺 看板和燃尽图 Sprint2 6.8/6.9/6.10/6.11/6.12/6.13/6.14
1.开始一个新的冲刺: 起止:2016.6.1~2016.6.14 按照以下过程进行 ProductBacklog:继续向下细化 Sprint 计划会议:确定此次冲刺要完成的目标 Sprint Bac ...
- EC读书笔记系列之8:条款13、14、15
条款13 以对象管理资源 记住: ★为防止资源泄漏,请使用RAII对象,它们在构造函数中获得资源并在析构函数中释放 ★两个常被使用的RAII classes分别是tr1::shared_ptr和aut ...
- RH033读书笔记(13)-Lab 14 Network Clients
Goal: Practice using a variety of tools to transfer files between your system and a remote system. S ...
- 12,13,14节-51单片机ESP8266学习-AT指令(暂停更新)需要整理
从这一节开始,以视频加源码的形式,后期视频和程序将放在链接中 资料链接 链接: https://pan.baidu.com/s/1jpHZjW_7pQKNfN9G4B6ZjA 密码:nhn3 ...
- 阅读<构建之法>13、14、15、16、17章
13章 这么多测试为什么不能整理出一个包括所有功能的测试呢?看着那么多测试都感觉奇怪了. 14章 怎样才能体现一个测试人员的工作价值呢?这样的判断又是否会太独断了? 15章 在时间上,会不会因不同功能 ...
- intellij idea 13&14 插件推荐及高速上手建议 (已更新!)
早些年 在外企的时候,公司用的是intellij idea ,当时也是从eclipse.MyEclipse转过去的非常是不习惯. 用了一周明显感觉爱上它了.由于它非常智能,并且能纠正你非常多不好的习惯 ...
随机推荐
- leetCode(40):Path Sum
Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all ...
- linux下nginx+php+mysql 自助环境搭建
++++++++++++++++++++++++++++++++++++++++++++++linux下nginx+php+mysql环境搭建+++++++++++++++++++++++++++++ ...
- ok6410[002] ubuntu1604系统下搭配ckermit和dnw基于RAM的裸机程序调试环境
ubuntu1604系统下搭配ckermit和dnw基于RAM的裸机程序调试环境 系统: ubuntu16.04 裸板: 飞凌公司OK6410开发板 目标:搭建基于ubuntu1604系统和基于RA ...
- matlab2016b -ubuntu 1604 -install- and -trouble -shooting--finally-all is ok!!
Linux系统下安装matlab2016b 标签: ubuntumatlablinux 2016-09-24 22:11 16203人阅读 评论(22) 收藏 举报 分类: linux 版权声明:本文 ...
- Active Directory虚拟机搭建域控服务器环境
前言 还是和上一章一样,痛苦过后还是记录下给后来人提供便利为妙. 虚拟机选择:建议Hyper-V或者VMware 系统选择:建议WIindows Server 2003及以上 我这里是使用VMware ...
- 对H.264帧类型判断方法
背景描述 我们经常在网络直播推流或者客户端拉流的时候,需要对获取到的H.264视频帧进行判断后处理,我们经常获取到各种不同的视频数据0x67 0x68 0x65 0x61,0x27 0x28 0x25 ...
- GO 入门(一)
1.下载安装go环境 https://golang.org/dl/ 2.检查环境变量配置情况,安装过程中会自动配置:GOROOT 和 Path 3.建立go工作区,并配置 ...
- 九度OJ 1107:搬水果 (贪心)
时间限制:1 秒 内存限制:32 兆 特殊判题:否 提交:5190 解决:1747 题目描述: 在一个果园里,小明已经将所有的水果打了下来,并按水果的不同种类分成了若干堆,小明决定把所有的水果合成一堆 ...
- 对小程序的网络请求的封装 wx.request 接收参数修改
wepy-mall/wxRequest.js at master · dyq086/wepy-mall https://github.com/dyq086/wepy-mall/blob/master/ ...
- ZOJ - 3935 2016 【数的筛选】
题目链接 http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3935 题意 要求找出 从 2016-990528 中 是闰年 并 ...