@awsekfozc
2016-01-08T19:35:57.000000Z
字数 2854
阅读 2281
Oozie
http://archive.cloudera.com/cdh5/cdh/5/oozie/DG_QuickStart.html
并下载extjs
http://dev.sencha.com/deploy/ext-2.2.zip
解压 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
nameNode=hdfs://cdh5.hadoop.com:8020
#这里很重要,端口一定要是 8032提交到yarn上运行
jobTracker=cdh5.hadoop.com:8032
queueName=default
examplesRoot=examples
oozie.wf.application.path=${nameNode}/user/${user.name}/${examplesRoot}/apps/map-reduce/workflow.xml
outputDir=map-reduce
运行一个任务
oozie job -oozie http://cdh5.hadoop.com:11000/oozie -config examples/apps/map-reduce/job.properties -run
在conf/oozie-site.xml 文件中找到以下几个属性,并修改为为mysql地址
拷贝mysql驱动包到libext目录下
<property>
<name>oozie.service.JPAService.jdbc.driver</name>
<value>com.mysql.jdbc.Driver</value>
</property>
<property>
<name>oozie.service.JPAService.jdbc.url</name>
<value>jdbc:mysql://cdh5.hadoop.com/oozie?createDatabaseIfNotExist=true</value>
</property>
<property>
<name>oozie.service.JPAService.jdbc.username</name>
<value>root</value>
</property>
<property>
<name>oozie.service.JPAService.jdbc.password</name>
<value>123456</value>
</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坏境
bin/oozie job -oozie http://cdh5.hadoop.com:11000/oozie -config examples/apps/map-reduce/job.properties -run
看到状态为SUCCEEDED,说明已经配置成功
再查看mysql下是否多了oozie的任务数据
修改conf/oozie-site.xml
<property>
<name>oozie.processing.timezone</name>
<value>GMT+0800</value>
</property>
修改oozie-server/webapps/oozie/oozie-console.js 177行代码
function getTimeZone() {
Ext.state.Manager.setProvider(new Ext.state.CookieProvider());
return Ext.state.Manager.get("TimezoneId","GMT+0800");
}
在getTimeZone下创建方法:
function getTimeZoneStr() {
Ext.state.Manager.setProvider(new Ext.state.CookieProvider());
return "GMT%2B0800";
}
修改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()