oozie job -oozie http://master:11000/oozie -config /opt/cloudera/parcels/CDH-5.7.2-1.cdh5.7.2.p0.18/share/doc/oozie-4.1.0+cdh5.7.2+282/examples/apps/*/job.properties -run
1.所有流程做了一个统一的例子
2.*:只需替换*文件夹路径
3.每次修改job.properties文件
4.配置文件在集群中的路径:/opt/cloudera/parcels/CDH-5.7.2-1.cdh5.7.2.p0.18/share/doc/oozie-4.1.0+cdh5.7.2+282/examples/apps/map-reduce/job.properties
//杀死一个oozie进程
1.map-reduce:
oozie job -oozie http://master:11000/oozie -config /opt/cloudera/parcels/CDH-5.7.2-1.cdh5.7.2.p0.18/share/doc/oozie-4.1.0+cdh5.7.2+282/examples/apps/map-reduce/job.properties -run
2.sqoop
oozie job -oozie http://master:11000/oozie -config /opt/cloudera/parcels/CDH-5.7.2-1.cdh5.7.2.p0.18/share/doc/oozie-4.1.0+cdh5.7.2+282/examples/apps/sqoop/job.properties -run
oozie调度sqoop导入数据到oracle---->最近在使用sqoop把oracle中的数据导入到hbase中, 表中的数据每个小时导入一次,使用oozie定时促发。
1.编辑coordinator.xml
<coordinator-app name="cfg_check_formula-coord" frequency="${coord:hours(1)}" start="${start}" end="${end}" timezone="UTC"
xmlns="uri:oozie:coordinator:0.2">
<controls>
<concurrency>1</concurrency>
</controls>
<action>
<workflow>
<app-path>${nameNode}/user/${coord:user()}/${tescommRoot}/apps/sqoop/cfg_check_formula</app-path>
</workflow>
</action>
</coordinator-app>
2.编辑workflow.xml
<workflow-app xmlns="uri:oozie:workflow:0.2" name="sqoop-cfg_check_formula-wf">
<start to="sqoop-node"/>
<action name="sqoop-node">
<sqoop xmlns="uri:oozie:sqoop-action:0.2">
<job-tracker>${jobTracker}</job-tracker>
<name-node>${nameNode}</name-node>
{nameNode}{wf:user()}{examplesRoot}{nameNode}{wf:user()}{examplesRoot}
<configuration>
<property>
<name>mapred.job.queue.name</name>
<value>${queueName}</value>
</property>
//重点配置sqoop导入数据
</configuration>
<arg>import</arg>
<arg>--connect</arg>
<arg>jdbc:oracle:thin:@127.0.0.1:1523:TEST</arg>
<arg>--username</arg>
<arg>ora</arg>
<arg>--password</arg>
<arg>111</arg>
<arg>--m</arg>
<arg>1</arg>
<arg>--query</arg>
//表明需指明别名
<arg>SELECT ROWID, a.* FROM cfg_check_formula a WHERE $CONDITIONS</arg>
<arg>--map-column-java</arg>
<arg>ROWID=String</arg>
<arg>--hbase-table</arg>
<arg>cfg_check_formula</arg>
<arg>--hbase-row-key</arg>
<arg>ROWID</arg>
<arg>--column-family</arg>
<arg>f_cfg_check_formula</arg>
</sqoop>
<ok to="end"/>
<error to="fail"/>
</action>
<kill name="fail">
<message>Sqoop import cfg_check_formula failed, error message[${wf:errorMessage(wf:lastErrorNode())}]</message>
</kill>
<end name="end"/>
</workflow-app>
3.编辑job.properties
nameNode=hdfs://master:8020
jobTracker=master:8032
queueName=default
testRoot=test
oozie.use.system.libpath=true
oozie.coord.application.path=${nameNode}/user/${user.name}/${testRoot}/apps/sqoop/cfg_check_formula
#start=2013-08-29T10:00Z
#end=2013-08-29T12:00Z
##注意时间格式
start=2013-09-04T11:00+0800
end=2013-09-04T12:00+0800
4.上述配置完后,在workflow目录下创建lib目录,把sqoop lib下的jar拷贝至这个目录下。这样我们就可以通过oozie定时启动这个导入任务
一、客户端命令
1.提交作业,作业进入PREP状态
oozie job -oozie http:
2.执行已提交的作业
oozie job -oozie http:
3.直接运行作业
oozie job -oozie http:
4.挂起作业,挂起前状态(RUNNING , RUNNIINGWITHERROR or PREP状态)
workflow job will be in SUSPENDED status.
5.杀死作业
oozie job -oozie http:
6.改变作业参数,不能修改killed状态的作业
oozie job -oozie http:
7.重新运行作业
oozie job -oozie http:
Rerunning a Coordinator Action or Multiple Actions
oozie job -rerun <coord_Job_id> [-nocleanup] [-refresh] [-action 1, 3-4, 7-40] [-date 2009-01-01T01:00Z::2009-05-31T23:59Z, 2009-11-10T01:00Z, 2009-12-31T22:00Z]
(-action or -date is required to rerun.)
Rerunning a Bundle Job
oozie job -rerun <bundle_Job_id> [-nocleanup] [-refresh] [-coordinator c1, c3, c4] [-date 2009-01-01T01:00Z::2009-05-31T23:59Z, 2009-11-10T01:00Z, 2009-12-31T22:00Z]
(-coordinator or -date is required to rerun.if neither -coordinator nor -date is given, the exception will be thrown.)
8.检查作业状态
oozie job -oozie http:
oozie job -oozie http:
9.查看日志
oozie job -oozie http:
oozie job -log <coord_job_id> [-action 1, 3-4, 7-40] (-action is optional.)
10.检查xml文件是否合规
oozie validate myApp/workflow.xml
11.提交pig作业
oozie pig -oozie http:
12.提交MR作业
oozie mapreduce -oozie http: