@tsing1226
2015-12-25T16:57:14.000000Z
字数 2380
阅读 1312
oozie
``
cat /etc/sysconfig/clock
复制相应的时区文件,替换系统时区文件;或者创建链接文件
sudo cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
sudo date -s 2015-12-30
sudo date -s 12:00:00
cp -r examples/apps/cron oozie-apps/
目前为止,Oozie coordinator是两种触发机制:时间名称和数据可用性。对于时间触发机制,一般有三个属性配置start time 、frequency、end time。
oozie时区问题
oozie默认使用UTC时区,而服务器上可能是CTS,建议统一使用GMT+0800。
在oozie-site.xml中添加
<property>
<name>oozie.processing.timezone</name>
<value>GMT+0800</value>
</property>
修改oozie-server/webapps/oozie/oozie-console.js里面的Timezone
function getTimeZone() {
Ext.state.Manager.setProvider(new Ext.state.CookieProvider());
return Ext.state.Manager.get("TimezoneId","GMT+0800");
}
job.properties
nameNode=hdfs://hadoop-senior01.grc.com:8020
jobTracker=hadoop-senior01.grc.com:8032
queueName=default
oozieAppsRoot=user/grc/oozie-apps
oozie.coord.application.path=${nameNode}/${oozieAppsRoot}/cron
start=2015-12-25T02:21+0800
end=2015-12-25T02:23+0800
workflowAppUri=${nameNode}/${oozieAppsRoot}/cron
coordinator.xml
<coordinator-app name="cron-coord" frequency="${coord:minutes(1)}" start="${start}" end="${end}" timezone="GMT+0800"
xmlns="uri:oozie:coordinator:0.2">
<action>
<workflow>
<app-path>${workflowAppUri}</app-path>
<configuration>
<property>
<name>jobTracker</name>
<value>${jobTracker}</value>
</property>
<property>
<name>nameNode</name>
<value>${nameNode}</value>
</property>
<property>
<name>queueName</name>
<value>${queueName}</value>
</property>
</configuration>
</workflow>
</action>
</coordinator-app>
workflow.xml
<workflow-app xmlns="uri:oozie:workflow:0.5" name="one-op-wf">
<start to="action1"/>
<action name="action1">
<fs/>
<ok to="end"/>
<error to="end"/>
</action>
<end name="end"/>
</workflow-app>
修改oozie-site.xml
实验中我们执行操作的频率是一分钟一次,但是oozie sevice coord检查时间为5分钟,所以我们将属性oozie.service.coord.check.maximum.frequency设置为false,跳过检查。
<property>
<name>oozie.service.coord.check.maximum.frequency</name>
<value>false</value>
<description>
When true, Oozie will reject any coordinators with a frequency faster than 5 minutes. It is not recommended to disable
this check or submit coordinators with frequencies faster than 5 minutes: doing so can cause unintended behavior and
additional system stress.
</description>
</property>
/opt/cdh3.5.6/hadoop-2.5.0-cdh5.3.6/bin/hdfs dfs -put oozie-apps/cron/oozie-apps/
bin/oozie job --config oozie-apps/cron/job.properties -run
参考地址:http://oozie.apache.org/docs/3.2.0-incubating/CoordinatorFunctionalSpec.html