Oozie运行Hive

springqingchun 2014-01-01

1.运行Hive需要用到hive-site.xml文件以及对应版本的hive的jar包,于是将hive-site.xml文件和当前所用hive版本下相关的jar包上传到HDFS上面。

2.修改examples/apps/hive/workflow.xml文件,主要添加对hive-site.xml配置的支持

<job-xml>${hiveSitePath}</job-xml>

其中需要注意事项:job-xml顺序

<xs:sequence>

<xs:elementname="job-tracker"type="xs:string"minOccurs="1"maxOccurs="1"/>

<xs:elementname="name-node"type="xs:string"minOccurs="1"maxOccurs="1"/>

<xs:elementname="prepare"type="hive:PREPARE"minOccurs="0"maxOccurs="1"/>

<xs:elementname="job-xml"type="xs:string"minOccurs="0"maxOccurs="1"/>

<xs:elementname="configuration"type="hive:CONFIGURATION"minOccurs="0"maxOccurs="1"/>

<xs:elementname="script"type="xs:string"minOccurs="1"maxOccurs="1"/>

<xs:elementname="param"type="xs:string"minOccurs="0"maxOccurs="unbounded"/>

<xs:elementname="file"type="xs:string"minOccurs="0"maxOccurs="unbounded"/>

<xs:elementname="archive"type="xs:string"minOccurs="0"maxOccurs="unbounded"/>

</xs:sequence>

3.修改examples/apps/hive/job.properties文件,在文件中添加相关位置的配置

hiveSitePath=${nameNode}/user/${user.name}/hive/hive-site.xml

oozie.libpath=${nameNode}/user/${user.name}/share/lib/hive

4.执行命令

bin/ooziejob-config../examples/apps/hive/job.properties-run

相关推荐