准备oozie-hadooplibs-4.1.0-cdh5.8.0.tar.gz、ext-2.2.zip、mysql-connector-java-5.1.45-bin.jar
一、添加OOZIE_HOME环境变量。
export OOZIE_HOME=/root/oozie-4.1.0-cdh5.8.0
export OOZIE_CONFIG=$OOZIE_HOME/conf
export PATH=$PATH:$OOZIE_HOME/bin
环境变量生效 source /etc/profie
二、在hadoop(/root/hadoop-2.6.0-cdh5.8.0/etc/hadoop)中修改core-site.xml
<property>
<name>hadoop.proxyuser.root.hosts</name>
<value>*</value>
</property>
<property>
<name>hadoop.proxyuser.root.groups</name>
<value>*</value>
</property>
三、在oozie安装目录下创建libext/目录:oozie-4.1.0-cdh5.8.0/oozie-4.1.0-cdh5.8.0/hadooplibs/拷贝进去。
cd $OOZIE_HOME/oozie-4.1.0-cdh5.8.0
解压:/root/oozie-4.1.0-cdh5.8.0 /oozie-hadooplibs-4.1.0-cdh5.8.0.tar.gz
tar -zxvf oozie-hadooplibs-4.1.0-cdh5.8.0.tar.gz
cp $OOZIE_HOME/oozie-4.1.0-cdh5.8.0/hadooplibs/ hadooplib-2.6.0-cdh5.8.0.oozie-4.1.0-cdh5.8.0/* libext/
cp ext-2.2.zip /libext
cp mysql的数据源 /libext
四、在$OOZIE_HOME/bin目录下执行
打包: ./oozie-setup.sh prepare-war (删除$OOZIE_HOME/oozie-server/temp 下面的oozie.pid)
Hdfs上传sharelib:./oozie-setup.sh sharelib create -fs hdfs://master:9000 -locallib$OOZIE_HOME/oozie-sharelib-4.1.0-cdh5.8.0-yarn.tar.gz
五、配置$OOZIE_HOME/conf/oozie-site.xml
<property>
<name>oozie.service.JPAService.create.db.schema</name>
<value>true</value>
</property>
<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://192.168.0.124:3306/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>
<!--设置Hadoop的配置文件的路径-->
<property>
<name>oozie.service.HadoopAccessorService.hadoop.configurations</name>
<value>*=/root/hadoop-2.6.0-cdh5.8.0/etc/hadoop</value>
<description>
Comma separatedAUTHORITY=HADOOP_CONF_DIR, where AUTHORITY is the HOST:PORT of
the Hadoop service (JobTracker, YARN,HDFS). The wildcard '*' configuration is
used when there is no exact match foran authority. The HADOOP_CONF_DIR contains
the relevant Hadoop *-site.xml files.If the path is relative is looked within
the Oozie configuration directory;though the path can be absolute (i.e. to point
to Hadoop client conf/ directories inthe local filesystem.
</description>
</property>
<!--
设置系统库存放在hdfs中,注意只有在job.properties中将设置oozie.use.system.libpath=true才会引用系统库
。注意,下面ns1是namenode的逻辑名称,根据自己集群的情况进行更改即可-->
<property>
<name>oozie.service.WorkflowAppService.system.libpath</name>
<value>hdfs://master:9000/user/root/share/lib</value>
<description>
System library path to use for workflowapplications.
This path is added to workflowapplication if their job properties sets
the property 'oozie.use.system.libpath'to true.
</description>
</property>
<property>
<name>oozie.service.HadoopAccessorService.action.configurations</name>
<value>*=/root/hadoop-2.6.0-cdh5.8.0/etc/hadoop</value>
</property>
配置$OOZIE_HOME/conf/oozie-default.xml
将oozie.services属性中的org.apache.oozie.service.JobsConcurrencyService值提到第一个位置。
六、创建数据库
./bin/ooziedb.sh create -sqlfileoozie.sql -run DB Connection
七、测试执行job
Hdfs dfs -put /root/oozie-4.1.0-cdh5.8.0/examples/user/root/
oozie job -ooziehttp://192.168.0.118:11000/oozie -config/root/oozie-4.1.0-cdh5.8.0/examples/apps/shell/job.properties -run
八、启动oozie
在$OOZIE_HOME/bin目录下
前台运行oozie:
./oozied.sh run
后台运行oozie:
./oozied.sh start
查看oozie网页:
http://ip:11000/oozie
停止oozie:
./oozied.sh stop
登录 | 立即注册