0、oozie只需安装在一台服务器上,这里选择在namenode上来安装;安装用户为cloud-user
1、安装Oozie包:
sudo yum install -y oozie oozie-client
2、对于yarn来说,需要修改/etc/oozie/conf/oozie-env.sh中:
CATALINA_BASE=/usr/lib/oozie/oozie-server
3、配置mysql:
yum install -y mysql-server
创建数据库:
mysql -u root -p
mysql> create database oozie;
mysql> grant all privileges on oozie.* to 'oozie'@'localhost' identified by 'oozie';
mysql> grant all privileges on oozie.* to 'oozie'@'%' identified by 'oozie';
mysql> exit
4、配置oozie-site.xml:
12 5oozie.service.JPAService.jdbc.driver 3com.mysql.jdbc.Driver 46 9oozie.service.JPAService.jdbc.url 7jdbc:mysql://10.0.0.2:3306/oozie 810 13oozie.service.JPAService.jdbc.username 11oozie 1214 17oozie.service.JPAService.jdbc.password 15oozie 1618 21oozie.action.mapreduce.uber.jar.enable 19true 2022 25oozie.service.HadoopAccessorService.supported.filesystems 23hdfs,viewfs 2426 29oozie.service.ProxyUserService.proxyuser.cloud-user.hosts 27* 2830 oozie.service.ProxyUserService.proxyuser.cloud-user.groups 31* 32
5、拷贝JDBC Driver:
sudo cp /usr/share/java/mysql-connector-java.jar /var/lib/oozie
sudo cp /usr/lib/hadoop/lib/hadoop-lzo-cdh4-0.4.15-gplextras.jar /var/lib/oozie
sudo cp /usr/lib/hadoop/lib/hadoop-lzo.jar /var/lib/oozie
6、创建oozie 数据库scheme,这一步骤需要root来执行:
su -
/usr/lib/oozie/bin/ooziedb.sh create -sqlfile oozie-create.sql
/usr/lib/oozie/bin/ooziedb.sh create -run
7、使能web console:
wget
sudo mv /var/lib/oozie/
cd /var/lib/oozie/ && sudo unzip
sudo chown -R oozie:oozie /var/lib/oozie/
8、安装Oozie ShareLib:
sudo -u hdfs hadoop fs -mkdir /user/oozie
sudo -u hdfs hadoop fs -chown oozie:oozie /user/oozie
mkdir /tmp/ooziesharelib
cd /tmp/ooziesharelib
tar xzf /usr/lib/oozie/oozie-sharelib-yarn.tar.gz
sudo -u oozie hadoop fs -put share /user/oozie/share
9、启动服务:
sudo service oozie start
10、测试map-reduce:
添加/etc/hadoop/conf/core-site.xml
12 5hadoop.proxyuser.oozie.hosts 310.0.0.2 46 hadoop.proxyuser.oozie.groups 7* 8
cp /usr/share/doc/oozie-3.3.2+100/oozie-examples.tar.gz .
tar -zxvf oozie-examples.tar.gz
修改example/apps/map-reduce/job.properties
nameNode=hdfs://10.0.0.2:8020
jobTracker=10.0.0.2:8032 端口改为/etc/hadoop/conf/yarn-site.xml中 'yarn.resourcemanager.address ' 项的值 hadoop fs -put examples oozie job -oozie http://10.0.0.3:11000/oozie -config ./examples/apps/no-op/job.properties -run
Job ID : 0000000-140508214215146-oozie-oozi-W
通过oozie job -oozie http://10.0.0.3:11000/oozie -log 0000000-140508214215146-oozie-oozi-W查看log
通过oozie job -oozie http://10.0.0.3:11000/oozie -info 0000000-140508214215146-oozie-oozi-W查看信息
通过http://namenode:11000/oozie查看web console