[关闭]
@awsekfozc 2016-01-08T19:35:57.000000Z 字数 2854 阅读 2296

oozie安装

Oozie


1)下载

http://archive.cloudera.com/cdh5/cdh/5/oozie/DG_QuickStart.html
并下载extjs
http://dev.sencha.com/deploy/ext-2.2.zip

2)安装

解压 oozie-hadooplibs-4.0.0-cdh5.3.6.tar.gz 到上一级目录

tar -zxvf oozie-hadooplibs-4.0.0-cdh5.3.6.tar.gz -C ../

创建 libext 目录

mkdir libext

拷贝对应的jar包到libext目录

cp hadooplibs/hadooplib-2.5.0-cdh5.3.6.oozie-4.0.0-cdh5.3.6/* libext

拷贝下载extjs.zip 到libext目录

运行命令三个命令
a) bin/oozie-setup.sh prepare-war
b) bin/oozie-setup.sh sharelib create -fs hdfs://cdh5.hadoop.com:8020 -locallib oozie-sharelib-4.0.0-cdh5.3.6-yarn.tar.gz
c)bin/ooziedb.sh create -sqlfile oozie.sql -run DB Connection
d) bin/oozied.sh start
e)解压 oozie-examples.tar.gz 得到 examples目录,并上传到hdfs当前用户的根目录
bin/hadoop dfs -put examples/ examples

3) 修改examples/apps/map-reduce/job.properties 文件

  1. nameNode=hdfs://cdh5.hadoop.com:8020
  2. #这里很重要,端口一定要是 8032提交到yarn上运行
  3. jobTracker=cdh5.hadoop.com:8032
  4. queueName=default
  5. examplesRoot=examples
  6. oozie.wf.application.path=${nameNode}/user/${user.name}/${examplesRoot}/apps/map-reduce/workflow.xml
  7. outputDir=map-reduce

运行一个任务
oozie job -oozie http://cdh5.hadoop.com:11000/oozie -config examples/apps/map-reduce/job.properties -run

3)配置oozie连接mysql

在conf/oozie-site.xml 文件中找到以下几个属性,并修改为为mysql地址
拷贝mysql驱动包到libext目录下

  1. <property>
  2. <name>oozie.service.JPAService.jdbc.driver</name>
  3. <value>com.mysql.jdbc.Driver</value>
  4. </property>
  5. <property>
  6. <name>oozie.service.JPAService.jdbc.url</name>
  7. <value>jdbc:mysql://cdh5.hadoop.com/oozie?createDatabaseIfNotExist=true</value>
  8. </property>
  9. <property>
  10. <name>oozie.service.JPAService.jdbc.username</name>
  11. <value>root</value>
  12. </property>
  13. <property>
  14. <name>oozie.service.JPAService.jdbc.password</name>
  15. <value>123456</value>
  16. </property>

由于mysql上没有oozie的初始化sql,所以需要初始化,运行命令
bin/ooziedb.sh create -sqlfile oozie.sql -run DB Connection

初始化完成后,如果立即启动oozie系统就会报错找不到mysql驱动“com.mysql.jdbc.Driver”,
由于oozie启动 类似tomcat启动,这里需要拷贝一个mysql驱动到oozie项目的lib目录下面,
oozie-server/webapps/oozie/WEB-INF/lib/
拷贝后启动oozie
oozied.sh start 访问就不会出现错误了

测试一下oozie坏境

  1. bin/oozie job -oozie http://cdh5.hadoop.com:11000/oozie -config examples/apps/map-reduce/job.properties -run

看到状态为SUCCEEDED,说明已经配置成功
oozied.png-51.4kB
再查看mysql下是否多了oozie的任务数据
oozied-mysql.png-34.8kB

4)oozie时区配置

修改conf/oozie-site.xml

  1. <property>
  2. <name>oozie.processing.timezone</name>
  3. <value>GMT+0800</value>
  4. </property>

修改oozie-server/webapps/oozie/oozie-console.js 177行代码

  1. function getTimeZone() {
  2. Ext.state.Manager.setProvider(new Ext.state.CookieProvider());
  3. return Ext.state.Manager.get("TimezoneId","GMT+0800");
  4. }

在getTimeZone下创建方法:

  1. function getTimeZoneStr() {
  2. Ext.state.Manager.setProvider(new Ext.state.CookieProvider());
  3. return "GMT%2B0800";
  4. }

修改oozie-console.js的524行:
原代码:

url:getOozieBase() + 'job/' + workflowId + "?timezone=" + getTimeZone()

修改为:

url:getOozieBase() + 'job/' + workflowId + "?timezone=" + getTimeZoneStr()

修改oozie-console.js的1685行:
原代码:

url: getOozieBase() + 'job/' + workflowId + "?timezone=" + getTimeZone()

修改为:

url: getOozieBase() + 'job/' + workflowId + "?timezone=" + getTimeZoneStr()

添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注