根据官网要求需要的环境如下
安装maven
下载链接Maven – Download Apache Maven
上传至服务器解压
修改环境变量
source 配置文件生效
source /etc/profile
测试是否安装成功
mvn -version
为了编译速度更快可以将maven源改成阿里源
修改方法就是将
安装msyql 这里就不多赘述自行安装
下载oozie
上传服务器解压
tar -xzvf oozie-4.3.1.tar.gz
进入目录,修改pox.xml文档:
vim pom.xml
将Hadoop版本修改成自己的版本
编译
bin/mkdistro.sh -DskipTests -Puber
报错:
解决办法:
在 home 目录下的 .m2/ 目录创建 settings.xml 文件,如下:
settings.xml 全文如下:
mirror-release.java.net mirror java.net release repository https://maven.java.net/content/repositories/releases/ releases.java.net mirror-jvnet-nexus-staging mirror jvnet-nexus-staging repository https://maven.java.net/content/repositories/staging/ jvnet-nexus-staging mirror-eclipse mirror eclipse repository https://download.eclipse.org/rt/eclipselink/maven.repo eclipse mirror-jvnet-nexus-snapshots mirror jvnet-nexus-snapshots repository https://maven.java.net/content/repositories/snapshots/ jvnet-nexus-snapshots nexus-aliyun * Nexus aliyun http://maven.aliyun.com/nexus/content/groups/public
并且删除maven conf目录下的settings.xml
进入maven的bin目录下运行
./mvn help:effective-settings
检查当前settings
解决问题后重新编译
将文件移动到/user/local 目录
[root@cm-server-1 local]# cp oozie-5.2.0/distro/target/oozie-5.0.0-distro.tar.gz /user/local
删除/user/local 目录下的oozie-5.2.0文件,因为解压oozie-5.2.0-distro.tar.gz文件解压后的文件名也是oozie-5.2.0,所以为防止文件冲突,将/user/local下的oozie-5.2.0文件删除
[root@cm-server-1 local]# rm -rf oozie-5.2.0
配置环境变量
vi /etc/profile
在里面加入下面三行:
export OOZIE_HOME=/home/ubuntu/oozie-4.3.1 export OOZIE_CONFIG=$OOZIE_HOME/conf export CLASSPATH=$CLASSPATH:$OOZIE_HOME/bin
编辑hadoop下的core-site.xml 添加如下内容
hadoop.proxyuser.root.hosts * hadoop.proxyuser.root.groups *
这里的root为用户名
不重启hadoop集群,而使配置生效
hdfs dfsadmin -refreshSuperUserGroupsConfiguration yarn rmadmin -refreshSuperUserGroupsConfiguration
下载 ext-2.2.zip
wget http://archive.cloudera.com/gplextras/misc/ext-2.2.zip
创建libext
将下载的ext-2.2.zip复制到libext下
cp ext-2.2.zip oozie-5.0.0/libext/
添加hadoop lib下的包
cp hadoop-2.6.0/share/hadoop/*/*.jar oozie-5.0.0/libext/ cp hadoop-2.6.0/share/hadoop/*/lib/*.jar oozie-5.0.0/libext/
将mysql驱动也放进libext
修改oozie的oozie-site.xml
进入oozie配置的文件夹:conf下
然后修改oozie-site.xml:
oozie.service.JPAService.jdbc.driver com.mysql.jdbc.Driver oozie.service.JPAService.jdbc.url jdbc:mysql://localhost:3306/oozie oozie.service.JPAService.jdbc.username root oozie.service.JPAService.jdbc.password root oozie.service.HadoopAccessorService.hadoop.configurations *=/usr/local/hadoop-2.6.5/etc/hadoop oozie.service.WorkflowAppService.system.libpath hdfs://master:9000/user/root/share/lib
进入mysql
mysql -uroot -p
创建oozie库
CREATE DATABASE oozie;
然后输入如下命令退出mysql
exit
将编译好的sharelib
复制到 user/local/oozie-5.2.0下
在hdfs上创建路径
[root@master /]# hdfs dfs -mkdir /user/root [root@master /]# hdfs dfs -mkdir /user/root/share [root@master /]# hdfs dfs -mkdir /user/root/share/lib
上传到jar到hdfs
bin/oozie-setup.sh sharelib create -fs hdfs://master:9000 -locallib oozie-sharelib-5.2.0.tar.gz
修改oozie-env.sh
vim conf/oozie-env.sh
然后添加如下内容:
# Set Java hoem and hadoop prefix export JAVA_HOME=/usr/local/jdk1.8.0 export OOZIE_PREFIX=/usr/local/oozie-5.2.0 # Set hadoop configuration path export OOZIE_CONF_DIR=/usr/local/oozie-5.2.0/conf/ export OOZIE_HOME=/usr/local/oozie-5.2.0 # add hadoop package export CLASSPATH=$CLASSPATH:$OOZIE_HOME/libext/*.jar
然后千万记得要soufce一下:
source conf/oozie-env.sh
在oozie关联mysql数据库
在启动oozie之前,记得先启动hadoop和jobhistory:
start-dfs.sh start-yarn.sh mr-jobhistory-daemon.sh start historyserver
进入oozie目录:
然后输入如下命令关联数据库:
bin/ooziedb.sh create -sqlfile oozie.sql -run
准备环境
bin/oozie-setup.sh
下一步启动oozie:
bin/oozied.sh start
然后输入下列命令查看oozie状态:
bin/oozie admin --oozie http://localhost:11000/oozie -status