oozie-4.0.0源码编译安装以及与hadoop-2.2.0整合

oozie下载

http://archive.apache.org/dist/oozie/4.0.0/oozie-4.0.0.tar.gz

wget http://archive.apache.org/dist/oozie/4.0.0/oozie-4.0.0.tar.gz

解压

tar xvf oozie-4.0.0.tar

解压后的目录结构为

scott@master:/var/tmp$ cd oozie-4.0.0/
scott@master:/var/tmp/oozie-4.0.0$ pwd
/var/tmp/oozie-4.0.0
scott@master:/var/tmp/oozie-4.0.0$ ll
总用量 256
drwxr-xr-x 20 scott scott 4096 8月 28 2013 ./
drwxrwxrwt 9 scott scott 4096 4月 14 15:30 ../
drwxr-xr-x 2 scott scott 4096 4月 14 15:30 bin/
drwxr-xr-x 2 scott scott 4096 4月 14 15:30 builds/
drwxr-xr-x 4 scott scott 4096 4月 14 15:30 build-setup/
drwxr-xr-x 3 scott scott 4096 4月 14 15:30 client/
drwxr-xr-x 3 scott scott 4096 4月 14 15:30 core/
-rw-r--r-- 1 scott scott 678 8月 28 2013 DISCLAIMER.txt
drwxr-xr-x 3 scott scott 4096 4月 14 15:30 distro/
drwxr-xr-x 3 scott scott 4096 4月 14 15:30 docs/
drwxr-xr-x 3 scott scott 4096 4月 14 15:30 examples/
-rw-r--r-- 1 scott scott 267 8月 28 2013 .gitignore
drwxr-xr-x 14 scott scott 4096 4月 14 15:30 hadooplibs/
drwxr-xr-x 3 scott scott 4096 4月 14 15:30 hbaselibs/
drwxr-xr-x 4 scott scott 4096 4月 14 15:30 hcataloglibs/
-rw-r--r-- 1 scott scott 37664 8月 28 2013 LICENSE.txt
drwxr-xr-x 3 scott scott 4096 4月 14 15:30 login/
drwxr-xr-x 3 scott scott 4096 4月 14 15:30 minitest/
-rw-r--r-- 1 scott scott 909 8月 28 2013 NOTICE.txt
-rw-r--r-- 1 scott scott 40684 8月 28 2013 pom.xml
-rw-r--r-- 1 scott scott 3167 8月 28 2013 README.txt
-rw-r--r-- 1 scott scott 58910 8月 28 2013 release-log.txt
drwxr-xr-x 10 scott scott 4096 4月 14 15:30 sharelib/
-rw-r--r-- 1 scott scott 2653 8月 28 2013 source-headers.txt
drwxr-xr-x 3 scott scott 4096 4月 14 15:30 src/
drwxr-xr-x 3 scott scott 4096 4月 14 15:30 tools/
drwxr-xr-x 3 scott scott 4096 4月 14 15:30 utils/
drwxr-xr-x 3 scott scott 4096 4月 14 15:30 webapp/
-rw-r--r-- 1 scott scott 13854 8月 28 2013 work.log

修正hadoop版本

scott@master:/var/tmp/oozie-4.0.0$ grep -l "2.2.0-SNAPSHOT" `find . -name "pom.xml"`
./pom.xml
./hadooplibs/hadoop-2/pom.xml
./hadooplibs/hadoop-distcp-2/pom.xml
./hadooplibs/hadoop-test-2/pom.xml
scott@master:/var/tmp/oozie-4.0.0$ grep -l "2.2.0-SNAPSHOT" `find . -name "pom.xml"` | xargs sed -i 's|2.2.0-SNAPSHOT|2.2.0|g'

设置maven环境

scott@master:/var/tmp/oozie-4.0.0$ export MAVEN_OPTS="-Xms1024M -Xmx1024M -XX:PermSize=256M -XX:MaxPermSize=256M"

使用maven开始编译

  • jdk6
mvn clean package assembly:single -Dhadoop.version=2.2.0 -DskipTests
  • jdk7
mvn clean package assembly:single -Dhadoop.version=2.2.0 -DjavaVersion=1.7 -DtargetJavaVersion=1.7 -DskipTests

由于我本机的jdk环境为jdk7.0所以

scott@master:/var/tmp/oozie-4.0.0$ mvn clean package assembly:single -Dhadoop.version=2.2.0 -DjavaVersion=1.7 -DtargetJavaVersion=1.7 -DskipTests

经过漫长的编译最终编译后的结果如下

[INFO] Building tar : /var/tmp/oozie-4.0.0/distro/target/oozie-4.0.0-distro.tar.gz
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Apache Oozie Main ................................. SUCCESS [16.629s]
[INFO] Apache Oozie Client ............................... SUCCESS [1:00.610s]
[INFO] Apache Oozie Hadoop 1.1.1.oozie-4.0.0 ............. SUCCESS [2.986s]
[INFO] Apache Oozie Hadoop Distcp 1.1.1.oozie-4.0.0 ...... SUCCESS [0.298s]
[INFO] Apache Oozie Hadoop 1.1.1.oozie-4.0.0 Test ........ SUCCESS [1.407s]
[INFO] Apache Oozie Hadoop 2.2.0.oozie-4.0.0 ............. SUCCESS [20.283s]
[INFO] Apache Oozie Hadoop 2.2.0.oozie-4.0.0 Test ........ SUCCESS [2.761s]
[INFO] Apache Oozie Hadoop Distcp 2.2.0.oozie-4.0.0 ...... SUCCESS [0.382s]
[INFO] Apache Oozie Hadoop 0.23.5.oozie-4.0.0 ............ SUCCESS [7.109s]
[INFO] Apache Oozie Hadoop 0.23.5.oozie-4.0.0 Test ....... SUCCESS [1.189s]
[INFO] Apache Oozie Hadoop Distcp 0.23.5.oozie-4.0.0 ..... SUCCESS [0.409s]
[INFO] Apache Oozie Hadoop Libs .......................... SUCCESS [25.008s]
[INFO] Apache Oozie Hbase 0.94.2.oozie-4.0.0 ............. SUCCESS [1.593s]
[INFO] Apache Oozie Hbase Libs ........................... SUCCESS [1.265s]
[INFO] Apache Oozie HCatalog 0.5.0.oozie-4.0.0 ........... SUCCESS [5.208s]
[INFO] Apache Oozie HCatalog 0.6.0.oozie-4.0.0 ........... SUCCESS [17.682s]
[INFO] Apache Oozie HCatalog Libs ........................ SUCCESS [4.848s]
[INFO] Apache Oozie Share Lib Oozie ...................... SUCCESS [20.437s]
[INFO] Apache Oozie Share Lib HCatalog ................... SUCCESS [16.627s]
[INFO] Apache Oozie Core ................................. SUCCESS [1:48.346s]
[INFO] Apache Oozie Docs ................................. SUCCESS [7.096s]
[INFO] Apache Oozie Share Lib Pig ........................ SUCCESS [38.542s]
[INFO] Apache Oozie Share Lib Hive ....................... SUCCESS [27.311s]
[INFO] Apache Oozie Share Lib Sqoop ...................... SUCCESS [13.992s]
[INFO] Apache Oozie Share Lib Streaming .................. SUCCESS [17.033s]
[INFO] Apache Oozie Share Lib Distcp ..................... SUCCESS [5.681s]
[INFO] Apache Oozie WebApp ............................... SUCCESS [9.874s]
[INFO] Apache Oozie Examples ............................. SUCCESS [30.980s]
[INFO] Apache Oozie Share Lib ............................ SUCCESS [32.681s]
[INFO] Apache Oozie Tools ................................ SUCCESS [34.815s]
[INFO] Apache Oozie MiniOozie ............................ SUCCESS [19.417s]
[INFO] Apache Oozie Distro ............................... SUCCESS [1:37.375s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 11:06.453s
[INFO] Finished at: Mon Apr 14 16:10:50 CST 2014

注:这里因为我是第二次构建了,所以所需的jar已经在本地缓存了,所以编译很快,我初次编译的时候花了将近3个小时。

安装oozie到/opt目录下

最终编译好的目录为

scott@master:/var/tmp/oozie-4.0.0/distro/target$ pwd
/var/tmp/oozie-4.0.0/distro/target
scott@master:/var/tmp/oozie-4.0.0/distro/target$ ll
总用量 144644
drwxrwxr-x 8 scott scott 4096 4月 14 16:10 ./
drwxr-xr-x 5 scott scott 4096 4月 14 16:09 ../
drwxrwxr-x 2 scott scott 4096 4月 14 16:09 antrun/
drwxrwxr-x 2 scott scott 4096 4月 14 16:10 archive-tmp/
drwxrwxr-x 2 scott scott 4096 4月 14 16:09 classes/
drwxrwxr-x 2 scott scott 4096 4月 14 16:09 maven-archiver/
drwxrwxr-x 3 scott scott 4096 4月 14 16:10 oozie-4.0.0-distro/
-rw-rw-r-- 1 scott scott 148073016 4月 14 16:10 oozie-4.0.0-distro.tar.gz
-rw-rw-r-- 1 scott scott 2841 4月 14 16:09 oozie-distro-4.0.0.jar
drwxrwxr-x 3 scott scott 4096 4月 14 16:10 tomcat/

解压oozie-4.0.0-distro.tar.gz文件到/opt目录中

scott@master:/var/tmp/oozie-4.0.0/distro/target$ tar zxvf oozie-4.0.0-distro.tar.gz -C /opt/

创建libext目录

scott@master:/var/tmp/oozie-4.0.0/distro/target$ cd /opt/oozie-4.0.0/
scott@master:/opt/oozie-4.0.0$ pwd
/opt/oozie-4.0.0
scott@master:/opt/oozie-4.0.0$ ll
总用量 86656
drwxrwxr-x 8 scott scott 4096 4月 14 16:27 ./
drwxr-xr-x 20 scott scott 4096 4月 14 16:26 ../
drwxrwxr-x 2 scott scott 4096 4月 14 16:27 bin/
drwxr-xr-x 4 scott scott 4096 4月 14 16:27 conf/
-rwxrwxr-x 1 scott scott 2415957 4月 14 16:05 docs.zip*
drwxrwxr-x 2 scott scott 4096 4月 14 16:27 lib/
drwxrwxr-x 2 scott scott 4096 4月 14 16:27 libtools/
-rwxrwxr-x 1 scott scott 9783357 4月 14 16:01 oozie-client-4.0.0.tar.gz*
drwxrwxr-x 2 scott scott 4096 4月 14 16:27 oozie-core/
-rwxrwxr-x 1 scott scott 31490 4月 14 16:07 oozie-examples.tar.gz*
drwxrwxr-x 9 scott scott 4096 4月 14 16:10 oozie-server/
-r--r--r-- 1 scott scott 55860554 4月 14 16:08 oozie-sharelib-4.0.0.tar.gz
-rwxrwxr-x 1 scott scott 20545530 4月 14 16:07 oozie.war*
-rw-r--r-- 1 scott scott 58910 8月 28 2013 release-log.txt
scott@master:/opt/oozie-4.0.0$ mkdir libext
scott@master:/opt/oozie-4.0.0$ ll
总用量 86660
drwxrwxr-x 9 scott scott 4096 4月 14 16:28 ./
drwxr-xr-x 20 scott scott 4096 4月 14 16:26 ../
drwxrwxr-x 2 scott scott 4096 4月 14 16:27 bin/
drwxr-xr-x 4 scott scott 4096 4月 14 16:27 conf/
-rwxrwxr-x 1 scott scott 2415957 4月 14 16:05 docs.zip*
drwxrwxr-x 2 scott scott 4096 4月 14 16:27 lib/
drwxrwxr-x 2 scott scott 4096 4月 14 16:28 libext/
drwxrwxr-x 2 scott scott 4096 4月 14 16:27 libtools/
-rwxrwxr-x 1 scott scott 9783357 4月 14 16:01 oozie-client-4.0.0.tar.gz*
drwxrwxr-x 2 scott scott 4096 4月 14 16:27 oozie-core/
-rwxrwxr-x 1 scott scott 31490 4月 14 16:07 oozie-examples.tar.gz*
drwxrwxr-x 9 scott scott 4096 4月 14 16:10 oozie-server/
-r--r--r-- 1 scott scott 55860554 4月 14 16:08 oozie-sharelib-4.0.0.tar.gz
-rwxrwxr-x 1 scott scott 20545530 4月 14 16:07 oozie.war*
-rw-r--r-- 1 scott scott 58910 8月 28 2013 release-log.txt

下载ext-2.2.zip到/opt/oozie-4.0.0/libext目录下

scott@master:/opt/oozie-4.0.0/libext$ wget http://extjs.com/deploy/ext-2.2.zip

拷贝hadoop2的jar包到libext目录下

由于我本机使用的是hadoop-2.2.0,所以我们从刚才源码构建oozie的目录下拷贝hadoop-2.2.0的jar

scott@master:/opt/oozie-4.0.0/libext$ cd /var/tmp/oozie-4.0.0/hadooplibs/hadoop-2/target/hadooplibs/hadooplib-2.2.0.oozie-4.0.0/
scott@master:/var/tmp/oozie-4.0.0/hadooplibs/hadoop-2/target/hadooplibs/hadooplib-2.2.0.oozie-4.0.0$ pwd
/var/tmp/oozie-4.0.0/hadooplibs/hadoop-2/target/hadooplibs/hadooplib-2.2.0.oozie-4.0.0
scott@master:/var/tmp/oozie-4.0.0/hadooplibs/hadoop-2/target/hadooplibs/hadooplib-2.2.0.oozie-4.0.0$ ll
总用量 22648
drwxrwxr-x 2 scott scott 4096 4月 14 16:01 ./
drwxrwxr-x 3 scott scott 4096 4月 14 16:01 ../
-rw-r--r-- 1 scott scott 303139 4月 14 16:01 avro-1.7.4.jar
-rw-r--r-- 1 scott scott 188671 4月 14 16:01 commons-beanutils-1.7.0.jar
-rw-r--r-- 1 scott scott 206035 4月 14 16:01 commons-beanutils-core-1.8.0.jar
-rw-r--r-- 1 scott scott 41123 4月 14 16:01 commons-cli-1.2.jar
-rw-r--r-- 1 scott scott 58160 4月 14 16:01 commons-codec-1.4.jar
-rw-r--r-- 1 scott scott 575389 4月 14 16:01 commons-collections-3.2.1.jar
-rw-r--r-- 1 scott scott 241367 4月 14 16:01 commons-compress-1.4.1.jar
-rw-r--r-- 1 scott scott 298829 4月 14 16:01 commons-configuration-1.6.jar
-rw-r--r-- 1 scott scott 143602 4月 14 16:01 commons-digester-1.8.jar
-rw-r--r-- 1 scott scott 305001 4月 14 16:01 commons-httpclient-3.1.jar
-rw-r--r-- 1 scott scott 163151 4月 14 16:01 commons-io-2.1.jar
-rw-r--r-- 1 scott scott 261809 4月 14 16:01 commons-lang-2.4.jar
-rw-r--r-- 1 scott scott 52915 4月 14 16:01 commons-logging-1.1.jar
-rw-r--r-- 1 scott scott 832410 4月 14 16:01 commons-math-2.1.jar
-rw-r--r-- 1 scott scott 273370 4月 14 16:01 commons-net-3.1.jar
-rw-r--r-- 1 scott scott 1648200 4月 14 16:01 guava-11.0.2.jar
-rw-r--r-- 1 scott scott 16778 4月 14 16:01 hadoop-annotations-2.2.0.jar
-rw-r--r-- 1 scott scott 45004 4月 14 16:01 hadoop-auth-2.0.2-alpha.jar
-rw-r--r-- 1 scott scott 2559 4月 14 16:01 hadoop-client-2.2.0.jar
-rw-r--r-- 1 scott scott 2735584 4月 14 16:01 hadoop-common-2.2.0.jar
-rw-r--r-- 1 scott scott 5242252 4月 14 16:01 hadoop-hdfs-2.2.0.jar
-rw-r--r-- 1 scott scott 482042 4月 14 16:01 hadoop-mapreduce-client-app-2.2.0.jar
-rw-r--r-- 1 scott scott 656365 4月 14 16:01 hadoop-mapreduce-client-common-2.2.0.jar
-rw-r--r-- 1 scott scott 1455001 4月 14 16:01 hadoop-mapreduce-client-core-2.2.0.jar
-rw-r--r-- 1 scott scott 35216 4月 14 16:01 hadoop-mapreduce-client-jobclient-2.2.0.jar
-rw-r--r-- 1 scott scott 21537 4月 14 16:01 hadoop-mapreduce-client-shuffle-2.2.0.jar
-rw-r--r-- 1 scott scott 1158936 4月 14 16:01 hadoop-yarn-api-2.2.0.jar
-rw-r--r-- 1 scott scott 94728 4月 14 16:01 hadoop-yarn-client-2.2.0.jar
-rw-r--r-- 1 scott scott 1301627 4月 14 16:01 hadoop-yarn-common-2.2.0.jar
-rw-r--r-- 1 scott scott 175554 4月 14 16:01 hadoop-yarn-server-common-2.2.0.jar
-rw-r--r-- 1 scott scott 227500 4月 14 16:01 jackson-core-asl-1.8.8.jar
-rw-r--r-- 1 scott scott 668564 4月 14 16:01 jackson-mapper-asl-1.8.8.jar
-rw-r--r-- 1 scott scott 177131 4月 14 16:01 jetty-util-6.1.26.jar
-rw-r--r-- 1 scott scott 33015 4月 14 16:01 jsr305-1.3.9.jar
-rw-r--r-- 1 scott scott 481535 4月 14 16:01 log4j-1.2.16.jar
-rw-r--r-- 1 scott scott 29555 4月 14 16:01 paranamer-2.3.jar
-rw-r--r-- 1 scott scott 533455 4月 14 16:01 protobuf-java-2.5.0.jar
-rw-r--r-- 1 scott scott 26176 4月 14 16:01 slf4j-api-1.6.6.jar
-rw-r--r-- 1 scott scott 9711 4月 14 16:01 slf4j-log4j12-1.6.6.jar
-rw-r--r-- 1 scott scott 995968 4月 14 16:01 snappy-java-1.0.4.1.jar
-rw-r--r-- 1 scott scott 15010 4月 14 16:01 xmlenc-0.52.jar
-rw-r--r-- 1 scott scott 94672 4月 14 16:01 xz-1.0.jar
-rw-r--r-- 1 scott scott 779974 4月 14 16:01 zookeeper-3.4.5.jar
scott@master:/var/tmp/oozie-4.0.0/hadooplibs/hadoop-2/target/hadooplibs/hadooplib-2.2.0.oozie-4.0.0$ cp *.jar /opt/oozie-4.0.0/libext/
scott@master:/var/tmp/oozie-4.0.0/hadooplibs/hadoop-2/target/hadooplibs/hadooplib-2.2.0.oozie-4.0.0$ cd /opt/oozie-4.0.0/libext/
scott@master:/opt/oozie-4.0.0/libext$ ll
总用量 29292
drwxrwxr-x 2 scott scott 4096 4月 14 16:33 ./
drwxrwxr-x 9 scott scott 4096 4月 14 16:28 ../
-rw-r--r-- 1 scott scott 303139 4月 14 16:33 avro-1.7.4.jar
-rw-r--r-- 1 scott scott 188671 4月 14 16:33 commons-beanutils-1.7.0.jar
-rw-r--r-- 1 scott scott 206035 4月 14 16:33 commons-beanutils-core-1.8.0.jar
-rw-r--r-- 1 scott scott 41123 4月 14 16:33 commons-cli-1.2.jar
-rw-r--r-- 1 scott scott 58160 4月 14 16:33 commons-codec-1.4.jar
-rw-r--r-- 1 scott scott 575389 4月 14 16:33 commons-collections-3.2.1.jar
-rw-r--r-- 1 scott scott 241367 4月 14 16:33 commons-compress-1.4.1.jar
-rw-r--r-- 1 scott scott 298829 4月 14 16:33 commons-configuration-1.6.jar
-rw-r--r-- 1 scott scott 143602 4月 14 16:33 commons-digester-1.8.jar
-rw-r--r-- 1 scott scott 305001 4月 14 16:33 commons-httpclient-3.1.jar
-rw-r--r-- 1 scott scott 163151 4月 14 16:33 commons-io-2.1.jar
-rw-r--r-- 1 scott scott 261809 4月 14 16:33 commons-lang-2.4.jar
-rw-r--r-- 1 scott scott 52915 4月 14 16:33 commons-logging-1.1.jar
-rw-r--r-- 1 scott scott 832410 4月 14 16:33 commons-math-2.1.jar
-rw-r--r-- 1 scott scott 273370 4月 14 16:33 commons-net-3.1.jar
-rw-rw-r-- 1 scott scott 6800612 10月 24 2008 ext-2.2.zip
-rw-r--r-- 1 scott scott 1648200 4月 14 16:33 guava-11.0.2.jar
-rw-r--r-- 1 scott scott 16778 4月 14 16:33 hadoop-annotations-2.2.0.jar
-rw-r--r-- 1 scott scott 45004 4月 14 16:33 hadoop-auth-2.0.2-alpha.jar
-rw-r--r-- 1 scott scott 2559 4月 14 16:33 hadoop-client-2.2.0.jar
-rw-r--r-- 1 scott scott 2735584 4月 14 16:33 hadoop-common-2.2.0.jar
-rw-r--r-- 1 scott scott 5242252 4月 14 16:33 hadoop-hdfs-2.2.0.jar
-rw-r--r-- 1 scott scott 482042 4月 14 16:33 hadoop-mapreduce-client-app-2.2.0.jar
-rw-r--r-- 1 scott scott 656365 4月 14 16:33 hadoop-mapreduce-client-common-2.2.0.jar
-rw-r--r-- 1 scott scott 1455001 4月 14 16:33 hadoop-mapreduce-client-core-2.2.0.jar
-rw-r--r-- 1 scott scott 35216 4月 14 16:33 hadoop-mapreduce-client-jobclient-2.2.0.jar
-rw-r--r-- 1 scott scott 21537 4月 14 16:33 hadoop-mapreduce-client-shuffle-2.2.0.jar
-rw-r--r-- 1 scott scott 1158936 4月 14 16:33 hadoop-yarn-api-2.2.0.jar
-rw-r--r-- 1 scott scott 94728 4月 14 16:33 hadoop-yarn-client-2.2.0.jar
-rw-r--r-- 1 scott scott 1301627 4月 14 16:33 hadoop-yarn-common-2.2.0.jar
-rw-r--r-- 1 scott scott 175554 4月 14 16:33 hadoop-yarn-server-common-2.2.0.jar
-rw-r--r-- 1 scott scott 227500 4月 14 16:33 jackson-core-asl-1.8.8.jar
-rw-r--r-- 1 scott scott 668564 4月 14 16:33 jackson-mapper-asl-1.8.8.jar
-rw-r--r-- 1 scott scott 177131 4月 14 16:33 jetty-util-6.1.26.jar
-rw-r--r-- 1 scott scott 33015 4月 14 16:33 jsr305-1.3.9.jar
-rw-r--r-- 1 scott scott 481535 4月 14 16:33 log4j-1.2.16.jar
-rw-r--r-- 1 scott scott 29555 4月 14 16:33 paranamer-2.3.jar
-rw-r--r-- 1 scott scott 533455 4月 14 16:33 protobuf-java-2.5.0.jar
-rw-r--r-- 1 scott scott 26176 4月 14 16:33 slf4j-api-1.6.6.jar
-rw-r--r-- 1 scott scott 9711 4月 14 16:33 slf4j-log4j12-1.6.6.jar
-rw-r--r-- 1 scott scott 995968 4月 14 16:33 snappy-java-1.0.4.1.jar
-rw-r--r-- 1 scott scott 15010 4月 14 16:33 xmlenc-0.52.jar
-rw-r--r-- 1 scott scott 94672 4月 14 16:33 xz-1.0.jar
-rw-r--r-- 1 scott scott 779974 4月 14 16:33 zookeeper-3.4.5.jar

替换hadoop-auth-2.0.2-alpha.jar

替换hadoop-auth-2.0.2-alpha.jar为hadoop安装目录下的/opt/hadoop-2.2.0/share/hadoop/common/lib/hadoop-auth-2.2.0.jar

由于hadoop-auth-2.0.2-alpha.jar里面缺少类,在后面的步骤中会报ClassNotFoundException: org.apache.hadoop.util.PlatformName,这里我的hadoop-2.2.0安装目录为/opt/hadoop-2.2.0

scott@master:/opt/oozie-4.0.0/libext$ rm -fr hadoop-auth-2.0.2-alpha.jar
scott@master:/opt/oozie-4.0.0/libext$ cp /opt/hadoop-2.2.0/share/hadoop/common/lib/hadoop-auth-2.2.0.jar .
scott@master:/opt/oozie-4.0.0/libext$ ll
总用量 29300
drwxrwxr-x 2 scott scott 4096 4月 14 16:39 ./
drwxrwxr-x 9 scott scott 4096 4月 14 16:28 ../
-rw-r--r-- 1 scott scott 303139 4月 14 16:33 avro-1.7.4.jar
-rw-r--r-- 1 scott scott 188671 4月 14 16:33 commons-beanutils-1.7.0.jar
-rw-r--r-- 1 scott scott 206035 4月 14 16:33 commons-beanutils-core-1.8.0.jar
-rw-r--r-- 1 scott scott 41123 4月 14 16:33 commons-cli-1.2.jar
-rw-r--r-- 1 scott scott 58160 4月 14 16:33 commons-codec-1.4.jar
-rw-r--r-- 1 scott scott 575389 4月 14 16:33 commons-collections-3.2.1.jar
-rw-r--r-- 1 scott scott 241367 4月 14 16:33 commons-compress-1.4.1.jar
-rw-r--r-- 1 scott scott 298829 4月 14 16:33 commons-configuration-1.6.jar
-rw-r--r-- 1 scott scott 143602 4月 14 16:33 commons-digester-1.8.jar
-rw-r--r-- 1 scott scott 305001 4月 14 16:33 commons-httpclient-3.1.jar
-rw-r--r-- 1 scott scott 163151 4月 14 16:33 commons-io-2.1.jar
-rw-r--r-- 1 scott scott 261809 4月 14 16:33 commons-lang-2.4.jar
-rw-r--r-- 1 scott scott 52915 4月 14 16:33 commons-logging-1.1.jar
-rw-r--r-- 1 scott scott 832410 4月 14 16:33 commons-math-2.1.jar
-rw-r--r-- 1 scott scott 273370 4月 14 16:33 commons-net-3.1.jar
-rw-rw-r-- 1 scott scott 6800612 10月 24 2008 ext-2.2.zip
-rw-r--r-- 1 scott scott 1648200 4月 14 16:33 guava-11.0.2.jar
-rw-r--r-- 1 scott scott 16778 4月 14 16:33 hadoop-annotations-2.2.0.jar
-rw-r--r-- 1 scott scott 49750 4月 14 16:39 hadoop-auth-2.2.0.jar
-rw-r--r-- 1 scott scott 2559 4月 14 16:33 hadoop-client-2.2.0.jar
-rw-r--r-- 1 scott scott 2735584 4月 14 16:33 hadoop-common-2.2.0.jar
-rw-r--r-- 1 scott scott 5242252 4月 14 16:33 hadoop-hdfs-2.2.0.jar
-rw-r--r-- 1 scott scott 482042 4月 14 16:33 hadoop-mapreduce-client-app-2.2.0.jar
-rw-r--r-- 1 scott scott 656365 4月 14 16:33 hadoop-mapreduce-client-common-2.2.0.jar
-rw-r--r-- 1 scott scott 1455001 4月 14 16:33 hadoop-mapreduce-client-core-2.2.0.jar
-rw-r--r-- 1 scott scott 35216 4月 14 16:33 hadoop-mapreduce-client-jobclient-2.2.0.jar
-rw-r--r-- 1 scott scott 21537 4月 14 16:33 hadoop-mapreduce-client-shuffle-2.2.0.jar
-rw-r--r-- 1 scott scott 1158936 4月 14 16:33 hadoop-yarn-api-2.2.0.jar
-rw-r--r-- 1 scott scott 94728 4月 14 16:33 hadoop-yarn-client-2.2.0.jar
-rw-r--r-- 1 scott scott 1301627 4月 14 16:33 hadoop-yarn-common-2.2.0.jar
-rw-r--r-- 1 scott scott 175554 4月 14 16:33 hadoop-yarn-server-common-2.2.0.jar
-rw-r--r-- 1 scott scott 227500 4月 14 16:33 jackson-core-asl-1.8.8.jar
-rw-r--r-- 1 scott scott 668564 4月 14 16:33 jackson-mapper-asl-1.8.8.jar
-rw-r--r-- 1 scott scott 177131 4月 14 16:33 jetty-util-6.1.26.jar
-rw-r--r-- 1 scott scott 33015 4月 14 16:33 jsr305-1.3.9.jar
-rw-r--r-- 1 scott scott 481535 4月 14 16:33 log4j-1.2.16.jar
-rw-r--r-- 1 scott scott 29555 4月 14 16:33 paranamer-2.3.jar
-rw-r--r-- 1 scott scott 533455 4月 14 16:33 protobuf-java-2.5.0.jar
-rw-r--r-- 1 scott scott 26176 4月 14 16:33 slf4j-api-1.6.6.jar
-rw-r--r-- 1 scott scott 9711 4月 14 16:33 slf4j-log4j12-1.6.6.jar
-rw-r--r-- 1 scott scott 995968 4月 14 16:33 snappy-java-1.0.4.1.jar
-rw-r--r-- 1 scott scott 15010 4月 14 16:33 xmlenc-0.52.jar
-rw-r--r-- 1 scott scott 94672 4月 14 16:33 xz-1.0.jar
-rw-r--r-- 1 scott scott 779974 4月 14 16:33 zookeeper-3.4.5.jar

由于添加了jar包,重新构建oozie.war

scott@master:/opt/oozie-4.0.0$ bin/oozie-setup.sh prepare-war
setting CATALINA_OPTS="$CATALINA_OPTS -Xmx1024m"

INFO: Adding extension: /opt/oozie-4.0.0/libext/avro-1.7.4.jar
INFO: Adding extension: /opt/oozie-4.0.0/libext/commons-beanutils-1.7.0.jar
INFO: Adding extension: /opt/oozie-4.0.0/libext/commons-beanutils-core-1.8.0.jar
INFO: Adding extension: /opt/oozie-4.0.0/libext/commons-cli-1.2.jar
INFO: Adding extension: /opt/oozie-4.0.0/libext/commons-codec-1.4.jar
INFO: Adding extension: /opt/oozie-4.0.0/libext/commons-collections-3.2.1.jar
INFO: Adding extension: /opt/oozie-4.0.0/libext/commons-compress-1.4.1.jar
INFO: Adding extension: /opt/oozie-4.0.0/libext/commons-configuration-1.6.jar
INFO: Adding extension: /opt/oozie-4.0.0/libext/commons-digester-1.8.jar
INFO: Adding extension: /opt/oozie-4.0.0/libext/commons-httpclient-3.1.jar
INFO: Adding extension: /opt/oozie-4.0.0/libext/commons-io-2.1.jar
INFO: Adding extension: /opt/oozie-4.0.0/libext/commons-lang-2.4.jar
INFO: Adding extension: /opt/oozie-4.0.0/libext/commons-logging-1.1.jar
INFO: Adding extension: /opt/oozie-4.0.0/libext/commons-math-2.1.jar
INFO: Adding extension: /opt/oozie-4.0.0/libext/commons-net-3.1.jar
INFO: Adding extension: /opt/oozie-4.0.0/libext/guava-11.0.2.jar
INFO: Adding extension: /opt/oozie-4.0.0/libext/hadoop-annotations-2.2.0.jar
INFO: Adding extension: /opt/oozie-4.0.0/libext/hadoop-auth-2.2.0.jar
INFO: Adding extension: /opt/oozie-4.0.0/libext/hadoop-client-2.2.0.jar
INFO: Adding extension: /opt/oozie-4.0.0/libext/hadoop-common-2.2.0.jar
INFO: Adding extension: /opt/oozie-4.0.0/libext/hadoop-hdfs-2.2.0.jar
INFO: Adding extension: /opt/oozie-4.0.0/libext/hadoop-mapreduce-client-app-2.2.0.jar
INFO: Adding extension: /opt/oozie-4.0.0/libext/hadoop-mapreduce-client-common-2.2.0.jar
INFO: Adding extension: /opt/oozie-4.0.0/libext/hadoop-mapreduce-client-core-2.2.0.jar
INFO: Adding extension: /opt/oozie-4.0.0/libext/hadoop-mapreduce-client-jobclient-2.2.0.jar
INFO: Adding extension: /opt/oozie-4.0.0/libext/hadoop-mapreduce-client-shuffle-2.2.0.jar
INFO: Adding extension: /opt/oozie-4.0.0/libext/hadoop-yarn-api-2.2.0.jar
INFO: Adding extension: /opt/oozie-4.0.0/libext/hadoop-yarn-client-2.2.0.jar
INFO: Adding extension: /opt/oozie-4.0.0/libext/hadoop-yarn-common-2.2.0.jar
INFO: Adding extension: /opt/oozie-4.0.0/libext/hadoop-yarn-server-common-2.2.0.jar
INFO: Adding extension: /opt/oozie-4.0.0/libext/jackson-core-asl-1.8.8.jar
INFO: Adding extension: /opt/oozie-4.0.0/libext/jackson-mapper-asl-1.8.8.jar
INFO: Adding extension: /opt/oozie-4.0.0/libext/jetty-util-6.1.26.jar
INFO: Adding extension: /opt/oozie-4.0.0/libext/jsr305-1.3.9.jar
INFO: Adding extension: /opt/oozie-4.0.0/libext/log4j-1.2.16.jar
INFO: Adding extension: /opt/oozie-4.0.0/libext/paranamer-2.3.jar
INFO: Adding extension: /opt/oozie-4.0.0/libext/protobuf-java-2.5.0.jar
INFO: Adding extension: /opt/oozie-4.0.0/libext/slf4j-api-1.6.6.jar
INFO: Adding extension: /opt/oozie-4.0.0/libext/slf4j-log4j12-1.6.6.jar
INFO: Adding extension: /opt/oozie-4.0.0/libext/snappy-java-1.0.4.1.jar
INFO: Adding extension: /opt/oozie-4.0.0/libext/xmlenc-0.52.jar
INFO: Adding extension: /opt/oozie-4.0.0/libext/xz-1.0.jar
INFO: Adding extension: /opt/oozie-4.0.0/libext/zookeeper-3.4.5.jar

New Oozie WAR file with added 'ExtJS library, JARs' at /opt/oozie-4.0.0/oozie-server/webapps/oozie.war


INFO: Oozie is ready to be started

在hadoop的core-site.xml配置文件中添加

<property> 
<name>hadoop.proxyuser.[OOZIE_SERVER_USER].hosts</name>
<value>[OOZIE_SERVER_HOSTNAME]</value>
</property>
<property>
<name>hadoop.proxyuser.[OOZIE_SERVER_USER].groups</name>
<value>[USER_GROUPS_THAT_ALLOW_IMPERSONATION]</value>
</property>

这里我添加的内容为

<property> 
<name>hadoop.proxyuser.scott.hosts</name>
<value>master</value>
</property>
<property>
<name>hadoop.proxyuser.scott.groups</name>
<value>scott</value>
</property>

其中scott为当前登录用户名和当前登录用户所属的组

修改oozie-site.xml,在/opt/oozie-4.0.0/conf/oozie-site.xml配置文件中添加

<property>
<name>oozie.service.ProxyUserService.proxyuser.scott.hosts</name>
<value>*</value>
</property>

<property>
<name>oozie.service.ProxyUserService.proxyuser.scott.groups</name>
<value>*</value>
</property>

<property>
<name>oozie.service.ProxyUserService.proxyuser.hue.hosts</name>
<value>*</value>
</property>

<property>
<name>oozie.service.ProxyUserService.proxyuser.hue.groups</name>
<value>*</value>
</property>

其中scott、hue均为用户名

修改/opt/oozie-4.0.0/conf/hadoop-config.xml文件

添加以下内容

<property>
<name>mapreduce.framework.name</name>
<value>yarn</value>
</property>

<property>
<name>yarn.resourcemanager.address</name>
<value>master:8032</value>
</property>

<property>
<name>yarn.resourcemanager.scheduler.address</name>
<value>master:8030</value>
</property>

<property>
<name>mapreduce.jobhistory.address</name>
<value>master:10020</value>
</property>

<property>
<name>mapreduce.jobhistory.webapp.address</name>
<value>master:19888</value>
</property>

这里master为hadoop所处的namenode机器的主机名,务必确保这里的配置与hadoop集群中的配置环境一致,且确保相关服务均已开启,否则后面的实验则不保证会成功

同理修改/opt/oozie-4.0.0/conf/hadoop-conf/core-site.xml文件

添加以下内容

<property>
<name>mapreduce.framework.name</name>
<value>yarn</value>
</property>

<property>
<name>yarn.resourcemanager.address</name>
<value>master:8032</value>
</property>

<property>
<name>yarn.resourcemanager.scheduler.address</name>
<value>master:8030</value>
</property>

<property>
<name>mapreduce.jobhistory.address</name>
<value>master:10020</value>
</property>

<property>
<name>mapreduce.jobhistory.webapp.address</name>
<value>master:19888</value>
</property>

同理,这里的配置与hadoop中的配置需要一致。由于hadoop2.2.0中jobtrack已经不存在了,已经使用resourcemanager来代替,所以这里务必要配置yarn.resourcemanager.address即master:8032,否则后面的运行将不成功。

解压并上传oozie-sharelib

解压oozie-sharelib-4.0.0.tar.gz

scott@master:/opt/oozie-4.0.0$ tar zxvf oozie-sharelib-4.0.0.tar.gz 
share/
share/lib/
share/lib/pig/
share/lib/pig/jython-2.5.3.jar
share/lib/pig/xmlenc-0.52.jar
share/lib/pig/asm-3.1.jar
share/lib/pig/commons-net-1.4.1.jar
share/lib/pig/guava-11.0.2.jar
share/lib/pig/qdox-1.10.1.jar
share/lib/pig/oozie-sharelib-pig-4.0.0.jar
share/lib/pig/slf4j-api-1.6.6.jar
share/lib/pig/paranamer-generator-2.2.jar
share/lib/pig/antlr-2.7.7.jar
share/lib/pig/jsr305-1.3.9.jar
share/lib/pig/commons-codec-1.4.jar
share/lib/pig/paranamer-ant-2.2.jar
share/lib/pig/jackson-mapper-asl-1.8.8.jar
share/lib/pig/commons-cli-1.2.jar
share/lib/pig/avro-1.3.2.jar
share/lib/pig/hsqldb-1.8.0.7.jar
share/lib/pig/commons-lang-2.4.jar
share/lib/pig/pig-0.10.1-.jar
share/lib/pig/paranamer-2.2.jar
share/lib/pig/jline-0.9.94.jar
share/lib/pig/jackson-core-asl-1.8.8.jar
share/lib/pig/antlr-runtime-3.4.jar
share/lib/pig/stringtemplate-3.2.1.jar
share/lib/mapreduce-streaming/
share/lib/mapreduce-streaming/oozie-sharelib-streaming-4.0.0.jar
share/lib/mapreduce-streaming/hadoop-streaming-2.2.0.jar
share/lib/hive/
share/lib/hive/xz-1.0.jar
share/lib/hive/hive-service-0.10.0.jar
share/lib/hive/commons-logging-api-1.0.4.jar
share/lib/hive/slf4j-log4j12-1.6.6.jar
share/lib/hive/avro-ipc-1.7.1.jar
share/lib/hive/asm-3.1.jar
share/lib/hive/datanucleus-core-2.0.3.jar
share/lib/hive/jetty-6.1.14.jar
share/lib/hive/hive-metastore-0.10.0.jar
share/lib/hive/stringtemplate-3.1-b1.jar
share/lib/hive/hive-builtins-0.10.0.jar
share/lib/hive/derby-10.6.1.0.jar
share/lib/hive/avro-mapred-1.7.1.jar
share/lib/hive/datanucleus-enhancer-2.0.3.jar
share/lib/hive/commons-dbcp-1.4.jar
share/lib/hive/commons-collections-3.2.1.jar
share/lib/hive/zookeeper-3.4.3.jar
share/lib/hive/paranamer-2.3.jar
share/lib/hive/slf4j-api-1.6.6.jar
share/lib/hive/netty-3.2.2.Final.jar
share/lib/hive/httpclient-4.1.3.jar
share/lib/hive/antlr-2.7.7.jar
share/lib/hive/httpcore-4.1.3.jar
share/lib/hive/datanucleus-rdbms-2.0.3.jar
share/lib/hive/libthrift-0.9.0.jar
share/lib/hive/commons-codec-1.4.jar
share/lib/hive/netty-3.6.2.Final.jar
share/lib/hive/hive-cli-0.10.0.jar
share/lib/hive/commons-pool-1.5.4.jar
share/lib/hive/antlr-3.0.1.jar
share/lib/hive/commons-logging-1.1.jar
share/lib/hive/jackson-mapper-asl-1.8.8.jar
share/lib/hive/commons-cli-1.2.jar
share/lib/hive/antlr-runtime-3.0.1.jar
share/lib/hive/jetty-util-6.1.26.jar
share/lib/hive/log4j-1.2.16.jar
share/lib/hive/commons-lang-2.4.jar
share/lib/hive/jdo2-api-2.3-ec.jar
share/lib/hive/snappy-java-1.0.4.1.jar
share/lib/hive/velocity-1.7.jar
share/lib/hive/jline-0.9.94.jar
share/lib/hive/hive-pdk-0.10.0.jar
share/lib/hive/servlet-api-2.5-6.1.14.jar
share/lib/hive/mockito-all-1.8.5.jar
share/lib/hive/hive-serde-0.10.0.jar
share/lib/hive/avro-1.7.4.jar
share/lib/hive/hive-common-0.10.0.jar
share/lib/hive/jackson-core-asl-1.8.8.jar
share/lib/hive/commons-compress-1.4.1.jar
share/lib/hive/hive-exec-0.10.0.jar
share/lib/hive/libfb303-0.7.0.jar
share/lib/hive/oozie-sharelib-hive-4.0.0.jar
share/lib/hive/hive-shims-0.10.0.jar
share/lib/hive/datanucleus-connectionpool-2.0.3.jar
share/lib/hive/servlet-api-2.5-20081211.jar
share/lib/hive/hive-contrib-0.10.0.jar
share/lib/sqoop/
share/lib/sqoop/commons-io-2.1.jar
share/lib/sqoop/hsqldb-1.8.0.7.jar
share/lib/sqoop/sqoop-1.4.3-hadoop100.jar
share/lib/sqoop/oozie-sharelib-sqoop-4.0.0.jar
share/lib/oozie/
share/lib/oozie/json-simple-1.1.jar
share/lib/oozie/oozie-sharelib-oozie-4.0.0.jar
share/lib/distcp/
share/lib/distcp/hadoop-distcp-2.2.0.jar
share/lib/distcp/oozie-sharelib-distcp-4.0.0.jar
share/lib/hcatalog/
share/lib/hcatalog/commons-configuration-1.6.jar
share/lib/hcatalog/xz-1.0.jar
share/lib/hcatalog/avro-ipc-1.7.1.jar
share/lib/hcatalog/jetty-6.1.14.jar
share/lib/hcatalog/hive-metastore-0.10.0.jar
share/lib/hcatalog/oozie-hcatalog-0.5.0.oozie-4.0.0.jar
share/lib/hcatalog/avro-mapred-1.7.1.jar
share/lib/hcatalog/paranamer-2.3.jar
share/lib/hcatalog/oozie-sharelib-hcatalog-4.0.0.jar
share/lib/hcatalog/commons-beanutils-1.7.0.jar
share/lib/hcatalog/netty-3.6.2.Final.jar
share/lib/hcatalog/commons-beanutils-core-1.8.0.jar
share/lib/hcatalog/hcatalog-core-0.5.0-incubating.jar
share/lib/hcatalog/jetty-util-6.1.26.jar
share/lib/hcatalog/commons-digester-1.8.jar
share/lib/hcatalog/snappy-java-1.0.4.1.jar
share/lib/hcatalog/velocity-1.7.jar
share/lib/hcatalog/avro-1.7.1.jar
share/lib/hcatalog/servlet-api-2.5-6.1.14.jar
share/lib/hcatalog/hive-serde-0.10.0.jar
share/lib/hcatalog/hive-common-0.10.0.jar
share/lib/hcatalog/commons-compress-1.4.1.jar
share/lib/hcatalog/hive-exec-0.10.0.jar
share/lib/hcatalog/libfb303-0.7.0.jar
share/lib/hcatalog/javolution-5.5.1.jar
share/lib/hcatalog/servlet-api-2.5-20081211.jar
share/lib/hcatalog/webhcat-java-client-0.5.0-incubating.jar
share/lib/sharelib.properties

确保启动hadoop集群,将解压后的share目录上传到hdfs文件系统中(将上传到/user/scott/share/lib目录下,这里scott为当前用户)

scott@master:/opt/oozie-4.0.0$ bin/oozie-setup.sh sharelib create -fs hdfs://master:9000
setting CATALINA_OPTS="$CATALINA_OPTS -Xmx1024m"
log4j:WARN No appenders could be found for logger (org.apache.hadoop.util.Shell).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/opt/oozie-4.0.0/libtools/slf4j-log4j12-1.6.6.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/opt/oozie-4.0.0/libtools/slf4j-simple-1.6.6.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/opt/oozie-4.0.0/libext/slf4j-log4j12-1.6.6.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
the destination path for sharelib is: /user/scott/share/lib

查看hdfs文件系统上是否存在

scott@master:/opt/oozie-4.0.0$ hdfs dfs -ls -R /user/scott/share/lib
drwxr-xr-x - scott supergroup 0 2014-04-14 16:55 /user/scott/share/lib/distcp
-rw-r--r-- 3 scott supergroup 80385 2014-04-14 16:55 /user/scott/share/lib/distcp/hadoop-distcp-2.2.0.jar
-rw-r--r-- 3 scott supergroup 2793 2014-04-14 16:55 /user/scott/share/lib/distcp/oozie-sharelib-distcp-4.0.0.jar
drwxr-xr-x - scott supergroup 0 2014-04-14 16:56 /user/scott/share/lib/hcatalog
-rw-r--r-- 3 scott supergroup 297845 2014-04-14 16:56 /user/scott/share/lib/hcatalog/avro-1.7.1.jar
-rw-r--r-- 3 scott supergroup 184944 2014-04-14 16:55 /user/scott/share/lib/hcatalog/avro-ipc-1.7.1.jar
-rw-r--r-- 3 scott supergroup 168868 2014-04-14 16:56 /user/scott/share/lib/hcatalog/avro-mapred-1.7.1.jar
-rw-r--r-- 3 scott supergroup 188671 2014-04-14 16:56 /user/scott/share/lib/hcatalog/commons-beanutils-1.7.0.jar
-rw-r--r-- 3 scott supergroup 206035 2014-04-14 16:56 /user/scott/share/lib/hcatalog/commons-beanutils-core-1.8.0.jar
-rw-r--r-- 3 scott supergroup 241367 2014-04-14 16:56 /user/scott/share/lib/hcatalog/commons-compress-1.4.1.jar
-rw-r--r-- 3 scott supergroup 298829 2014-04-14 16:55 /user/scott/share/lib/hcatalog/commons-configuration-1.6.jar
-rw-r--r-- 3 scott supergroup 143602 2014-04-14 16:56 /user/scott/share/lib/hcatalog/commons-digester-1.8.jar
-rw-r--r-- 3 scott supergroup 237800 2014-04-14 16:56 /user/scott/share/lib/hcatalog/hcatalog-core-0.5.0-incubating.jar
-rw-r--r-- 3 scott supergroup 68033 2014-04-14 16:56 /user/scott/share/lib/hcatalog/hive-common-0.10.0.jar
-rw-r--r-- 3 scott supergroup 4854977 2014-04-14 16:56 /user/scott/share/lib/hcatalog/hive-exec-0.10.0.jar
-rw-r--r-- 3 scott supergroup 3081632 2014-04-14 16:56 /user/scott/share/lib/hcatalog/hive-metastore-0.10.0.jar
-rw-r--r-- 3 scott supergroup 634640 2014-04-14 16:56 /user/scott/share/lib/hcatalog/hive-serde-0.10.0.jar
-rw-r--r-- 3 scott supergroup 395195 2014-04-14 16:56 /user/scott/share/lib/hcatalog/javolution-5.5.1.jar
-rw-r--r-- 3 scott supergroup 516429 2014-04-14 16:56 /user/scott/share/lib/hcatalog/jetty-6.1.14.jar
-rw-r--r-- 3 scott supergroup 177131 2014-04-14 16:56 /user/scott/share/lib/hcatalog/jetty-util-6.1.26.jar
-rw-r--r-- 3 scott supergroup 175982 2014-04-14 16:56 /user/scott/share/lib/hcatalog/libfb303-0.7.0.jar
-rw-r--r-- 3 scott supergroup 1199572 2014-04-14 16:56 /user/scott/share/lib/hcatalog/netty-3.6.2.Final.jar
-rw-r--r-- 3 scott supergroup 2688 2014-04-14 16:56 /user/scott/share/lib/hcatalog/oozie-hcatalog-0.5.0.oozie-4.0.0.jar
-rw-r--r-- 3 scott supergroup 10112 2014-04-14 16:56 /user/scott/share/lib/hcatalog/oozie-sharelib-hcatalog-4.0.0.jar
-rw-r--r-- 3 scott supergroup 29555 2014-04-14 16:56 /user/scott/share/lib/hcatalog/paranamer-2.3.jar
-rw-r--r-- 3 scott supergroup 134133 2014-04-14 16:56 /user/scott/share/lib/hcatalog/servlet-api-2.5-20081211.jar
-rw-r--r-- 3 scott supergroup 132368 2014-04-14 16:56 /user/scott/share/lib/hcatalog/servlet-api-2.5-6.1.14.jar
-rw-r--r-- 3 scott supergroup 995968 2014-04-14 16:56 /user/scott/share/lib/hcatalog/snappy-java-1.0.4.1.jar
-rw-r--r-- 3 scott supergroup 449505 2014-04-14 16:56 /user/scott/share/lib/hcatalog/velocity-1.7.jar
-rw-r--r-- 3 scott supergroup 39888 2014-04-14 16:56 /user/scott/share/lib/hcatalog/webhcat-java-client-0.5.0-incubating.jar
-rw-r--r-- 3 scott supergroup 94672 2014-04-14 16:55 /user/scott/share/lib/hcatalog/xz-1.0.jar
drwxr-xr-x - scott supergroup 0 2014-04-14 16:56 /user/scott/share/lib/hive
-rw-r--r-- 3 scott supergroup 445288 2014-04-14 16:56 /user/scott/share/lib/hive/antlr-2.7.7.jar
-rw-r--r-- 3 scott supergroup 562325 2014-04-14 16:56 /user/scott/share/lib/hive/antlr-3.0.1.jar
-rw-r--r-- 3 scott supergroup 105209 2014-04-14 16:56 /user/scott/share/lib/hive/antlr-runtime-3.0.1.jar
-rw-r--r-- 3 scott supergroup 43033 2014-04-14 16:56 /user/scott/share/lib/hive/asm-3.1.jar
-rw-r--r-- 3 scott supergroup 303139 2014-04-14 16:56 /user/scott/share/lib/hive/avro-1.7.4.jar
-rw-r--r-- 3 scott supergroup 184944 2014-04-14 16:56 /user/scott/share/lib/hive/avro-ipc-1.7.1.jar
-rw-r--r-- 3 scott supergroup 168868 2014-04-14 16:56 /user/scott/share/lib/hive/avro-mapred-1.7.1.jar
-rw-r--r-- 3 scott supergroup 41123 2014-04-14 16:56 /user/scott/share/lib/hive/commons-cli-1.2.jar
-rw-r--r-- 3 scott supergroup 58160 2014-04-14 16:56 /user/scott/share/lib/hive/commons-codec-1.4.jar
-rw-r--r-- 3 scott supergroup 575389 2014-04-14 16:56 /user/scott/share/lib/hive/commons-collections-3.2.1.jar
-rw-r--r-- 3 scott supergroup 241367 2014-04-14 16:56 /user/scott/share/lib/hive/commons-compress-1.4.1.jar
-rw-r--r-- 3 scott supergroup 160519 2014-04-14 16:56 /user/scott/share/lib/hive/commons-dbcp-1.4.jar
-rw-r--r-- 3 scott supergroup 261809 2014-04-14 16:56 /user/scott/share/lib/hive/commons-lang-2.4.jar
-rw-r--r-- 3 scott supergroup 52915 2014-04-14 16:56 /user/scott/share/lib/hive/commons-logging-1.1.jar
-rw-r--r-- 3 scott supergroup 26202 2014-04-14 16:56 /user/scott/share/lib/hive/commons-logging-api-1.0.4.jar
-rw-r--r-- 3 scott supergroup 96221 2014-04-14 16:56 /user/scott/share/lib/hive/commons-pool-1.5.4.jar
-rw-r--r-- 3 scott supergroup 16880 2014-04-14 16:56 /user/scott/share/lib/hive/datanucleus-connectionpool-2.0.3.jar
-rw-r--r-- 3 scott supergroup 2002412 2014-04-14 16:56 /user/scott/share/lib/hive/datanucleus-core-2.0.3.jar
-rw-r--r-- 3 scott supergroup 188159 2014-04-14 16:56 /user/scott/share/lib/hive/datanucleus-enhancer-2.0.3.jar
-rw-r--r-- 3 scott supergroup 1225113 2014-04-14 16:56 /user/scott/share/lib/hive/datanucleus-rdbms-2.0.3.jar
-rw-r--r-- 3 scott supergroup 2623509 2014-04-14 16:56 /user/scott/share/lib/hive/derby-10.6.1.0.jar
-rw-r--r-- 3 scott supergroup 3914 2014-04-14 16:56 /user/scott/share/lib/hive/hive-builtins-0.10.0.jar
-rw-r--r-- 3 scott supergroup 32636 2014-04-14 16:56 /user/scott/share/lib/hive/hive-cli-0.10.0.jar
-rw-r--r-- 3 scott supergroup 68033 2014-04-14 16:56 /user/scott/share/lib/hive/hive-common-0.10.0.jar
-rw-r--r-- 3 scott supergroup 112786 2014-04-14 16:56 /user/scott/share/lib/hive/hive-contrib-0.10.0.jar
-rw-r--r-- 3 scott supergroup 4854977 2014-04-14 16:56 /user/scott/share/lib/hive/hive-exec-0.10.0.jar
-rw-r--r-- 3 scott supergroup 3081632 2014-04-14 16:56 /user/scott/share/lib/hive/hive-metastore-0.10.0.jar
-rw-r--r-- 3 scott supergroup 14427 2014-04-14 16:56 /user/scott/share/lib/hive/hive-pdk-0.10.0.jar
-rw-r--r-- 3 scott supergroup 634640 2014-04-14 16:56 /user/scott/share/lib/hive/hive-serde-0.10.0.jar
-rw-r--r-- 3 scott supergroup 265212 2014-04-14 16:56 /user/scott/share/lib/hive/hive-service-0.10.0.jar
-rw-r--r-- 3 scott supergroup 117882 2014-04-14 16:56 /user/scott/share/lib/hive/hive-shims-0.10.0.jar
-rw-r--r-- 3 scott supergroup 352585 2014-04-14 16:56 /user/scott/share/lib/hive/httpclient-4.1.3.jar
-rw-r--r-- 3 scott supergroup 181201 2014-04-14 16:56 /user/scott/share/lib/hive/httpcore-4.1.3.jar
-rw-r--r-- 3 scott supergroup 227500 2014-04-14 16:56 /user/scott/share/lib/hive/jackson-core-asl-1.8.8.jar
-rw-r--r-- 3 scott supergroup 668564 2014-04-14 16:56 /user/scott/share/lib/hive/jackson-mapper-asl-1.8.8.jar
-rw-r--r-- 3 scott supergroup 198552 2014-04-14 16:56 /user/scott/share/lib/hive/jdo2-api-2.3-ec.jar
-rw-r--r-- 3 scott supergroup 516429 2014-04-14 16:56 /user/scott/share/lib/hive/jetty-6.1.14.jar
-rw-r--r-- 3 scott supergroup 177131 2014-04-14 16:56 /user/scott/share/lib/hive/jetty-util-6.1.26.jar
-rw-r--r-- 3 scott supergroup 87325 2014-04-14 16:56 /user/scott/share/lib/hive/jline-0.9.94.jar
-rw-r--r-- 3 scott supergroup 175982 2014-04-14 16:56 /user/scott/share/lib/hive/libfb303-0.7.0.jar
-rw-r--r-- 3 scott supergroup 347531 2014-04-14 16:56 /user/scott/share/lib/hive/libthrift-0.9.0.jar
-rw-r--r-- 3 scott supergroup 481535 2014-04-14 16:56 /user/scott/share/lib/hive/log4j-1.2.16.jar
-rw-r--r-- 3 scott supergroup 1419869 2014-04-14 16:56 /user/scott/share/lib/hive/mockito-all-1.8.5.jar
-rw-r--r-- 3 scott supergroup 785556 2014-04-14 16:56 /user/scott/share/lib/hive/netty-3.2.2.Final.jar
-rw-r--r-- 3 scott supergroup 1199572 2014-04-14 16:56 /user/scott/share/lib/hive/netty-3.6.2.Final.jar
-rw-r--r-- 3 scott supergroup 9912 2014-04-14 16:56 /user/scott/share/lib/hive/oozie-sharelib-hive-4.0.0.jar
-rw-r--r-- 3 scott supergroup 29555 2014-04-14 16:56 /user/scott/share/lib/hive/paranamer-2.3.jar
-rw-r--r-- 3 scott supergroup 134133 2014-04-14 16:56 /user/scott/share/lib/hive/servlet-api-2.5-20081211.jar
-rw-r--r-- 3 scott supergroup 132368 2014-04-14 16:56 /user/scott/share/lib/hive/servlet-api-2.5-6.1.14.jar
-rw-r--r-- 3 scott supergroup 26176 2014-04-14 16:56 /user/scott/share/lib/hive/slf4j-api-1.6.6.jar
-rw-r--r-- 3 scott supergroup 9711 2014-04-14 16:56 /user/scott/share/lib/hive/slf4j-log4j12-1.6.6.jar
-rw-r--r-- 3 scott supergroup 995968 2014-04-14 16:56 /user/scott/share/lib/hive/snappy-java-1.0.4.1.jar
-rw-r--r-- 3 scott supergroup 229928 2014-04-14 16:56 /user/scott/share/lib/hive/stringtemplate-3.1-b1.jar
-rw-r--r-- 3 scott supergroup 449505 2014-04-14 16:56 /user/scott/share/lib/hive/velocity-1.7.jar
-rw-r--r-- 3 scott supergroup 94672 2014-04-14 16:56 /user/scott/share/lib/hive/xz-1.0.jar
-rw-r--r-- 3 scott supergroup 767592 2014-04-14 16:56 /user/scott/share/lib/hive/zookeeper-3.4.3.jar
drwxr-xr-x - scott supergroup 0 2014-04-14 16:56 /user/scott/share/lib/mapreduce-streaming
-rw-r--r-- 3 scott supergroup 102797 2014-04-14 16:56 /user/scott/share/lib/mapreduce-streaming/hadoop-streaming-2.2.0.jar
-rw-r--r-- 3 scott supergroup 5663 2014-04-14 16:56 /user/scott/share/lib/mapreduce-streaming/oozie-sharelib-streaming-4.0.0.jar
drwxr-xr-x - scott supergroup 0 2014-04-14 16:56 /user/scott/share/lib/oozie
-rw-r--r-- 3 scott supergroup 16046 2014-04-14 16:56 /user/scott/share/lib/oozie/json-simple-1.1.jar
-rw-r--r-- 3 scott supergroup 35115 2014-04-14 16:56 /user/scott/share/lib/oozie/oozie-sharelib-oozie-4.0.0.jar
drwxr-xr-x - scott supergroup 0 2014-04-14 16:55 /user/scott/share/lib/pig
-rw-r--r-- 3 scott supergroup 445288 2014-04-14 16:55 /user/scott/share/lib/pig/antlr-2.7.7.jar
-rw-r--r-- 3 scott supergroup 164368 2014-04-14 16:55 /user/scott/share/lib/pig/antlr-runtime-3.4.jar
-rw-r--r-- 3 scott supergroup 43033 2014-04-14 16:55 /user/scott/share/lib/pig/asm-3.1.jar
-rw-r--r-- 3 scott supergroup 339671 2014-04-14 16:55 /user/scott/share/lib/pig/avro-1.3.2.jar
-rw-r--r-- 3 scott supergroup 41123 2014-04-14 16:55 /user/scott/share/lib/pig/commons-cli-1.2.jar
-rw-r--r-- 3 scott supergroup 58160 2014-04-14 16:55 /user/scott/share/lib/pig/commons-codec-1.4.jar
-rw-r--r-- 3 scott supergroup 261809 2014-04-14 16:55 /user/scott/share/lib/pig/commons-lang-2.4.jar
-rw-r--r-- 3 scott supergroup 180792 2014-04-14 16:55 /user/scott/share/lib/pig/commons-net-1.4.1.jar
-rw-r--r-- 3 scott supergroup 1648200 2014-04-14 16:55 /user/scott/share/lib/pig/guava-11.0.2.jar
-rw-r--r-- 3 scott supergroup 643727 2014-04-14 16:55 /user/scott/share/lib/pig/hsqldb-1.8.0.7.jar
-rw-r--r-- 3 scott supergroup 227500 2014-04-14 16:55 /user/scott/share/lib/pig/jackson-core-asl-1.8.8.jar
-rw-r--r-- 3 scott supergroup 668564 2014-04-14 16:55 /user/scott/share/lib/pig/jackson-mapper-asl-1.8.8.jar
-rw-r--r-- 3 scott supergroup 87325 2014-04-14 16:55 /user/scott/share/lib/pig/jline-0.9.94.jar
-rw-r--r-- 3 scott supergroup 33015 2014-04-14 16:55 /user/scott/share/lib/pig/jsr305-1.3.9.jar
-rw-r--r-- 3 scott supergroup 8302357 2014-04-14 16:55 /user/scott/share/lib/pig/jython-2.5.3.jar
-rw-r--r-- 3 scott supergroup 19089 2014-04-14 16:55 /user/scott/share/lib/pig/oozie-sharelib-pig-4.0.0.jar
-rw-r--r-- 3 scott supergroup 29392 2014-04-14 16:55 /user/scott/share/lib/pig/paranamer-2.2.jar
-rw-r--r-- 3 scott supergroup 5420 2014-04-14 16:55 /user/scott/share/lib/pig/paranamer-ant-2.2.jar
-rw-r--r-- 3 scott supergroup 6931 2014-04-14 16:55 /user/scott/share/lib/pig/paranamer-generator-2.2.jar
-rw-r--r-- 3 scott supergroup 3082514 2014-04-14 16:55 /user/scott/share/lib/pig/pig-0.10.1-.jar
-rw-r--r-- 3 scott supergroup 173236 2014-04-14 16:55 /user/scott/share/lib/pig/qdox-1.10.1.jar
-rw-r--r-- 3 scott supergroup 26176 2014-04-14 16:55 /user/scott/share/lib/pig/slf4j-api-1.6.6.jar
-rw-r--r-- 3 scott supergroup 148627 2014-04-14 16:55 /user/scott/share/lib/pig/stringtemplate-3.2.1.jar
-rw-r--r-- 3 scott supergroup 15010 2014-04-14 16:55 /user/scott/share/lib/pig/xmlenc-0.52.jar
-rw-r--r-- 3 scott supergroup 1345 2014-04-14 16:56 /user/scott/share/lib/sharelib.properties
drwxr-xr-x - scott supergroup 0 2014-04-14 16:56 /user/scott/share/lib/sqoop
-rw-r--r-- 3 scott supergroup 163151 2014-04-14 16:56 /user/scott/share/lib/sqoop/commons-io-2.1.jar
-rw-r--r-- 3 scott supergroup 643727 2014-04-14 16:56 /user/scott/share/lib/sqoop/hsqldb-1.8.0.7.jar
-rw-r--r-- 3 scott supergroup 7847 2014-04-14 16:56 /user/scott/share/lib/sqoop/oozie-sharelib-sqoop-4.0.0.jar
-rw-r--r-- 3 scott supergroup 658331 2014-04-14 16:56 /user/scott/share/lib/sqoop/sqoop-1.4.3-hadoop100.jar

这里要确保已经替换过hadoop-auth-2.0.2-alpha.jar,否则在该步操作的时候就会报ClassNotFoundException: org.apache.hadoop.util.PlatformName错误

创建oozie database

有两种方式

oozie-setup.sh db create -run

scott@master:/opt/oozie-4.0.0$ bin/oozie-setup.sh db create -run
setting CATALINA_OPTS="$CATALINA_OPTS -Xmx1024m"

Validate DB Connection
DONE
Check DB schema does not exist
DONE
Check OOZIE_SYS table does not exist
DONE
Create SQL schema
DONE
Create OOZIE_SYS table
DONE

Oozie DB has been created for Oozie version '4.0.0'


The SQL commands have been written to: /tmp/ooziedb-2485389516902219656.sql

ooziedb.sh create -sqlfile oozie.sql -run Validate DB Connection

scott@master:/opt/oozie-4.0.0$ bin/ooziedb.sh create -sqlfile oozie.sql -run Validate DB Connection
setting CATALINA_OPTS="$CATALINA_OPTS -Xmx1024m"

Validate DB Connection
DONE
Check DB schema does not exist
DONE
Check OOZIE_SYS table does not exist
DONE
Create SQL schema
DONE
Create OOZIE_SYS table
DONE

Oozie DB has been created for Oozie version '4.0.0'


The SQL commands have been written to: oozie.sql

使用后者将在目录下生成oozie.sql文件,具体内容为

scott@master:/opt/oozie-4.0.0$ ll
总用量 86680
drwxrwxr-x 12 scott scott 4096 4月 14 17:01 ./
drwxr-xr-x 20 scott scott 4096 4月 14 16:26 ../
drwxrwxr-x 2 scott scott 4096 4月 14 16:27 bin/
drwxr-xr-x 4 scott scott 4096 4月 14 16:27 conf/
drwxrwxr-x 3 scott scott 4096 4月 14 17:01 data/
-rwxrwxr-x 1 scott scott 2415957 4月 14 16:05 docs.zip*
drwxrwxr-x 2 scott scott 4096 4月 14 16:27 lib/
drwxrwxr-x 2 scott scott 4096 4月 14 16:39 libext/
drwxrwxr-x 2 scott scott 4096 4月 14 16:27 libtools/
drwxrwxr-x 2 scott scott 4096 4月 14 17:01 logs/
-rwxrwxr-x 1 scott scott 9783357 4月 14 16:01 oozie-client-4.0.0.tar.gz*
drwxrwxr-x 2 scott scott 4096 4月 14 16:27 oozie-core/
-rwxrwxr-x 1 scott scott 31490 4月 14 16:07 oozie-examples.tar.gz*
drwxrwxr-x 9 scott scott 4096 4月 14 16:10 oozie-server/
-r--r--r-- 1 scott scott 55860554 4月 14 16:08 oozie-sharelib-4.0.0.tar.gz
-rw-rw-r-- 1 scott scott 7802 4月 14 17:01 oozie.sql
-rwxrwxr-x 1 scott scott 20545530 4月 14 16:07 oozie.war*
-rw-r--r-- 1 scott scott 58910 8月 28 2013 release-log.txt
drwxr-xr-x 3 scott scott 4096 4月 14 16:05 share/
scott@master:/opt/oozie-4.0.0$ cat oozie.sql

oozie.sql

CREATE TABLE BUNDLE_ACTIONS -- BundleActionBean
(bundle_action_id VARCHAR(255) NOT NULL, bundle_id VARCHAR(255), coord_id VARCHAR(255), coord_name VARCHAR(255), critical INTEGER, last_modified_time TIMESTAMP, pending INTEGER, status VARCHAR(255), bean_type VARCHAR(31), PRIMARY KEY (bundle_action_id));
CREATE TABLE BUNDLE_JOBS -- JsonBundleJob
(id VARCHAR(255) NOT NULL, app_name VARCHAR(255), app_path VARCHAR(255), conf CLOB, external_id VARCHAR(255), group_name VARCHAR(255), time_out INTEGER, user_name VARCHAR(255), bean_type VARCHAR(31), created_time TIMESTAMP, end_time TIMESTAMP, job_xml CLOB, kickoff_time TIMESTAMP, last_modified_time TIMESTAMP, orig_job_xml CLOB, pause_time TIMESTAMP, pending INTEGER, start_time TIMESTAMP, status VARCHAR(255), suspended_time TIMESTAMP, time_unit VARCHAR(255), PRIMARY KEY (id));
CREATE TABLE COORD_ACTIONS -- JsonCoordinatorAction
(id VARCHAR(255) NOT NULL, action_number INTEGER, action_xml CLOB, console_url VARCHAR(255), created_conf CLOB, error_code VARCHAR(255), error_message VARCHAR(255), external_status VARCHAR(255), missing_dependencies CLOB, push_missing_dependencies CLOB, run_conf CLOB, time_out INTEGER, tracker_uri VARCHAR(255), job_type VARCHAR(255), bean_type VARCHAR(31), created_time TIMESTAMP, external_id VARCHAR(255), job_id VARCHAR(255), last_modified_time TIMESTAMP, nominal_time TIMESTAMP, pending INTEGER, rerun_time TIMESTAMP, sla_xml CLOB, status VARCHAR(255), PRIMARY KEY (id));
CREATE TABLE COORD_JOBS -- JsonCoordinatorJob
(id VARCHAR(255) NOT NULL, app_name VARCHAR(255), app_path VARCHAR(255), bundle_id VARCHAR(255), concurrency INTEGER, conf CLOB, external_id VARCHAR(255), frequency VARCHAR(255), group_name VARCHAR(255), last_action_number INTEGER, mat_throttling INTEGER, time_out INTEGER, time_zone VARCHAR(255), user_name VARCHAR(255), bean_type VARCHAR(31), app_namespace VARCHAR(255), created_time TIMESTAMP, done_materialization INTEGER, end_time TIMESTAMP, execution VARCHAR(255), job_xml CLOB, last_action TIMESTAMP, last_modified_time TIMESTAMP, next_matd_time TIMESTAMP, orig_job_xml CLOB, pause_time TIMESTAMP, pending INTEGER, sla_xml CLOB, start_time TIMESTAMP, status VARCHAR(255), suspended_time TIMESTAMP, time_unit VARCHAR(255), PRIMARY KEY (id));
CREATE TABLE OPENJPA_SEQUENCE_TABLE (ID SMALLINT NOT NULL, SEQUENCE_VALUE BIGINT, PRIMARY KEY (ID));
CREATE TABLE SLA_EVENTS -- JsonSLAEvent
(event_id BIGINT NOT NULL GENERATED BY DEFAULT AS IDENTITY, alert_contact VARCHAR(255), alert_frequency VARCHAR(255), alert_percentage VARCHAR(255), app_name VARCHAR(255), dev_contact VARCHAR(255), group_name VARCHAR(255), job_data CLOB, notification_msg CLOB, parent_client_id VARCHAR(255), parent_sla_id VARCHAR(255), qa_contact VARCHAR(255), se_contact VARCHAR(255), sla_id VARCHAR(255), upstream_apps CLOB, user_name VARCHAR(255), bean_type VARCHAR(31), app_type VARCHAR(255), event_type VARCHAR(255), expected_end TIMESTAMP, expected_start TIMESTAMP, job_status VARCHAR(255), status_timestamp TIMESTAMP, PRIMARY KEY (event_id));
CREATE TABLE SLA_REGISTRATION -- SLARegistrationBean
(job_id VARCHAR(255) NOT NULL, app_name VARCHAR(255), app_type VARCHAR(255), expected_duration BIGINT, expected_end TIMESTAMP, expected_start TIMESTAMP, job_data VARCHAR(255), nominal_time TIMESTAMP, notification_msg VARCHAR(255), parent_id VARCHAR(255), sla_config VARCHAR(255), upstream_apps VARCHAR(255), user_name VARCHAR(255), PRIMARY KEY (job_id));
CREATE TABLE SLA_SUMMARY -- SLASummaryBean
(job_id VARCHAR(255) NOT NULL, actual_duration BIGINT, actual_end TIMESTAMP, actual_start TIMESTAMP, app_name VARCHAR(255), app_type VARCHAR(255), event_processed SMALLINT, event_status VARCHAR(255), expected_duration BIGINT, expected_end TIMESTAMP, expected_start TIMESTAMP, job_status VARCHAR(255), last_modified TIMESTAMP, nominal_time TIMESTAMP, parent_id VARCHAR(255), sla_status VARCHAR(255), user_name VARCHAR(255), PRIMARY KEY (job_id));
CREATE TABLE VALIDATE_CONN -- ValidateConnectionBean
(id BIGINT NOT NULL, -- datastore id
dummy INTEGER, PRIMARY KEY (id));
CREATE TABLE WF_ACTIONS -- JsonWorkflowAction
(id VARCHAR(255) NOT NULL, conf CLOB, console_url VARCHAR(255), cred VARCHAR(255), data CLOB, error_code VARCHAR(255), error_message VARCHAR(500), external_child_ids CLOB, external_id VARCHAR(255), external_status VARCHAR(255), name VARCHAR(255), retries INTEGER, stats CLOB, tracker_uri VARCHAR(255), transition VARCHAR(255), type VARCHAR(255), user_retry_count INTEGER, user_retry_interval INTEGER, user_retry_max INTEGER, bean_type VARCHAR(31), end_time TIMESTAMP, execution_path VARCHAR(1024), last_check_time TIMESTAMP, log_token VARCHAR(255), pending INTEGER, pending_age TIMESTAMP, signal_value VARCHAR(255), sla_xml CLOB, start_time TIMESTAMP, status VARCHAR(255), wf_id VARCHAR(255), PRIMARY KEY (id));
CREATE TABLE WF_JOBS -- JsonWorkflowJob
(id VARCHAR(255) NOT NULL, app_name VARCHAR(255), app_path VARCHAR(255), conf CLOB, group_name VARCHAR(255), parent_id VARCHAR(255), run INTEGER, user_name VARCHAR(255), bean_type VARCHAR(31), created_time TIMESTAMP, end_time TIMESTAMP, external_id VARCHAR(255), last_modified_time TIMESTAMP, log_token VARCHAR(255), proto_action_conf CLOB, sla_xml CLOB, start_time TIMESTAMP, status VARCHAR(255), wf_instance BLOB, PRIMARY KEY (id));
CREATE INDEX I_BNDLTNS_DTYPE ON BUNDLE_ACTIONS (bean_type);
CREATE INDEX I_BNDLJBS_CREATED_TIME ON BUNDLE_JOBS (created_time);
CREATE INDEX I_BNDLJBS_DTYPE ON BUNDLE_JOBS (bean_type);
CREATE INDEX I_BNDLJBS_LAST_MODIFIED_TIME ON BUNDLE_JOBS (last_modified_time);
CREATE INDEX I_BNDLJBS_STATUS ON BUNDLE_JOBS (status);
CREATE INDEX I_BNDLJBS_SUSPENDED_TIME ON BUNDLE_JOBS (suspended_time);
CREATE INDEX I_CRD_TNS_CREATED_TIME ON COORD_ACTIONS (created_time);
CREATE INDEX I_CRD_TNS_DTYPE ON COORD_ACTIONS (bean_type);
CREATE INDEX I_CRD_TNS_EXTERNAL_ID ON COORD_ACTIONS (external_id);
CREATE INDEX I_CRD_TNS_JOB_ID ON COORD_ACTIONS (job_id);
CREATE INDEX I_CRD_TNS_LAST_MODIFIED_TIME ON COORD_ACTIONS (last_modified_time);
CREATE INDEX I_CRD_TNS_NOMINAL_TIME ON COORD_ACTIONS (nominal_time);
CREATE INDEX I_CRD_TNS_RERUN_TIME ON COORD_ACTIONS (rerun_time);
CREATE INDEX I_CRD_TNS_STATUS ON COORD_ACTIONS (status);
CREATE INDEX I_CRD_JBS_CREATED_TIME ON COORD_JOBS (created_time);
CREATE INDEX I_CRD_JBS_DTYPE ON COORD_JOBS (bean_type);
CREATE INDEX I_CRD_JBS_LAST_MODIFIED_TIME ON COORD_JOBS (last_modified_time);
CREATE INDEX I_CRD_JBS_NEXT_MATD_TIME ON COORD_JOBS (next_matd_time);
CREATE INDEX I_CRD_JBS_STATUS ON COORD_JOBS (status);
CREATE INDEX I_CRD_JBS_SUSPENDED_TIME ON COORD_JOBS (suspended_time);
CREATE INDEX I_SL_VNTS_DTYPE ON SLA_EVENTS (bean_type);
CREATE INDEX I_SL_RRTN_NOMINAL_TIME ON SLA_REGISTRATION (nominal_time);
CREATE INDEX I_SL_SMRY_APP_NAME ON SLA_SUMMARY (app_name);
CREATE INDEX I_SL_SMRY_EVENT_PROCESSED ON SLA_SUMMARY (event_processed);
CREATE INDEX I_SL_SMRY_LAST_MODIFIED ON SLA_SUMMARY (last_modified);
CREATE INDEX I_SL_SMRY_NOMINAL_TIME ON SLA_SUMMARY (nominal_time);
CREATE INDEX I_SL_SMRY_PARENT_ID ON SLA_SUMMARY (parent_id);
CREATE INDEX I_WF_CTNS_DTYPE ON WF_ACTIONS (bean_type);
CREATE INDEX I_WF_CTNS_PENDING_AGE ON WF_ACTIONS (pending_age);
CREATE INDEX I_WF_CTNS_STATUS ON WF_ACTIONS (status);
CREATE INDEX I_WF_CTNS_WF_ID ON WF_ACTIONS (wf_id);
CREATE INDEX I_WF_JOBS_DTYPE ON WF_JOBS (bean_type);
CREATE INDEX I_WF_JOBS_END_TIME ON WF_JOBS (end_time);
CREATE INDEX I_WF_JOBS_EXTERNAL_ID ON WF_JOBS (external_id);
CREATE INDEX I_WF_JOBS_LAST_MODIFIED_TIME ON WF_JOBS (last_modified_time);
CREATE INDEX I_WF_JOBS_STATUS ON WF_JOBS (status);

create table OOZIE_SYS (name varchar(100), data varchar(100))
insert into OOZIE_SYS (name, data) values ('db.version', '2')
insert into OOZIE_SYS (name, data) values ('oozie.version', '4.0.0')

启动oozie server

有两种方式启动

scott@master:/opt/oozie-4.0.0$ bin/oozied.sh start #以守护进程启动

scott@master:/opt/oozie-4.0.0$ bin/oozied.sh run #在前端运行

scott@master:/opt/oozie-4.0.0$ bin/oozied.sh start

Setting OOZIE_HOME: /opt/oozie-4.0.0
Setting OOZIE_CONFIG: /opt/oozie-4.0.0/conf
Sourcing: /opt/oozie-4.0.0/conf/oozie-env.sh
setting CATALINA_OPTS="$CATALINA_OPTS -Xmx1024m"
Setting OOZIE_CONFIG_FILE: oozie-site.xml
Setting OOZIE_DATA: /opt/oozie-4.0.0/data
Setting OOZIE_LOG: /opt/oozie-4.0.0/logs
Setting OOZIE_LOG4J_FILE: oozie-log4j.properties
Setting OOZIE_LOG4J_RELOAD: 10
Setting OOZIE_HTTP_HOSTNAME: master
Setting OOZIE_HTTP_PORT: 11000
Setting OOZIE_ADMIN_PORT: 11001
Setting OOZIE_HTTPS_PORT: 11443
Setting OOZIE_BASE_URL: http://master:11000/oozie
Setting CATALINA_BASE: /opt/oozie-4.0.0/oozie-server
Setting OOZIE_HTTPS_KEYSTORE_FILE: /home/scott/.keystore
Setting OOZIE_HTTPS_KEYSTORE_PASS: password
Setting CATALINA_OUT: /opt/oozie-4.0.0/logs/catalina.out
Setting CATALINA_PID: /opt/oozie-4.0.0/oozie-server/temp/oozie.pid

Using CATALINA_OPTS: -Xmx1024m -Dderby.stream.error.file=/opt/oozie-4.0.0/logs/derby.log
Adding to CATALINA_OPTS: -Doozie.home.dir=/opt/oozie-4.0.0 -Doozie.config.dir=/opt/oozie-4.0.0/conf -Doozie.log.dir=/opt/oozie-4.0.0/logs -Doozie.data.dir=/opt/oozie-4.0.0/data -Doozie.config.file=oozie-site.xml -Doozie.log4j.file=oozie-log4j.properties -Doozie.log4j.reload=10 -Doozie.http.hostname=master -Doozie.admin.port=11001 -Doozie.http.port=11000 -Doozie.https.port=11443 -Doozie.base.url=http://master:11000/oozie -Doozie.https.keystore.file=/home/scott/.keystore -Doozie.https.keystore.pass=password -Djava.library.path=

Using CATALINA_BASE: /opt/oozie-4.0.0/oozie-server
Using CATALINA_HOME: /opt/oozie-4.0.0/oozie-server
Using CATALINA_TMPDIR: /opt/oozie-4.0.0/oozie-server/temp
Using JRE_HOME: /opt/jdk1.7.0_51
Using CLASSPATH: /opt/oozie-4.0.0/oozie-server/bin/bootstrap.jar
Using CATALINA_PID: /opt/oozie-4.0.0/oozie-server/temp/oozie.pid

在/opt/oozie-4.0.0/logs/oozie.log查看日志

浏览器访问http://master:11000/oozie/

oozie-init.png

注:这里master为当前主机名称

在终端检查oozie server状态

scott@master:/opt/oozie-4.0.0$ bin/oozie admin -oozie http://master:11000/oozie -status
System mode: NORMAL

检查oozie 进程

scott@master:/opt/oozie-4.0.0$ ps aux | grep oozie
scott 29726 10.0 16.7 1859768 169764 pts/0 Sl 17:05 0:26 /opt/jdk1.7.0_51/bin/java -Djava.util.logging.config.file=/opt/oozie-4.0.0/oozie-server/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Xmx1024m -Dderby.stream.error.file=/opt/oozie-4.0.0/logs/derby.log -Doozie.home.dir=/opt/oozie-4.0.0 -Doozie.config.dir=/opt/oozie-4.0.0/conf -Doozie.log.dir=/opt/oozie-4.0.0/logs -Doozie.data.dir=/opt/oozie-4.0.0/data -Doozie.config.file=oozie-site.xml -Doozie.log4j.file=oozie-log4j.properties -Doozie.log4j.reload=10 -Doozie.http.hostname=master -Doozie.admin.port=11001 -Doozie.http.port=11000 -Doozie.https.port=11443 -Doozie.base.url=http://master:11000/oozie -Doozie.https.keystore.file=/home/scott/.keystore -Doozie.https.keystore.pass=password -Djava.library.path= -Djava.endorsed.dirs=/opt/oozie-4.0.0/oozie-server/endorsed -classpath /opt/oozie-4.0.0/oozie-server/bin/bootstrap.jar -Dcatalina.base=/opt/oozie-4.0.0/oozie-server -Dcatalina.home=/opt/oozie-4.0.0/oozie-server -Djava.io.tmpdir=/opt/oozie-4.0.0/oozie-server/temp org.apache.catalina.startup.Bootstrap start

运行oozie自带的测试例子

解压oozie-examples.tar.gz

scott@master:/opt/oozie-4.0.0$ tar zxvf oozie-examples.tar.gz 
examples/src/
examples/src/org/
examples/src/org/apache/
examples/src/org/apache/oozie/
examples/src/org/apache/oozie/example/
examples/src/org/apache/oozie/example/DemoReducer.java
examples/src/org/apache/oozie/example/SampleReducer.java
examples/src/org/apache/oozie/example/DemoMapReduceMain.java
examples/src/org/apache/oozie/example/DemoMapper.java
examples/src/org/apache/oozie/example/TimeUnit.java
examples/src/org/apache/oozie/example/SampleMapper.java
examples/src/org/apache/oozie/example/DemoJavaMain.java
examples/src/org/apache/oozie/example/LocalOozieExample.java
examples/src/org/apache/oozie/example/DateList.java
examples/src/org/apache/oozie/example/DemoPigMain.java
examples/src/org/apache/oozie/example/Repeatable.java
examples/apps/
examples/apps/pig/
examples/apps/aggregator/
examples/apps/java-main/
examples/apps/custom-main/
examples/apps/ssh/
examples/apps/sqoop-freeform/
examples/apps/distcp/
examples/apps/shell/
examples/apps/streaming/
examples/apps/hcatalog/
examples/apps/bundle/
examples/apps/datelist-java-main/
examples/apps/no-op/
examples/apps/hive/
examples/apps/sla/
examples/apps/subwf/
examples/apps/demo/
examples/apps/sqoop/
examples/apps/map-reduce/
examples/apps/cron/
examples/apps/hadoop-el/
examples/apps/pig/job.properties
examples/apps/pig/workflow.xml
examples/apps/pig/id.pig
examples/apps/aggregator/job.properties
examples/apps/aggregator/coordinator.xml
examples/apps/aggregator/job-with-offset.properties
examples/apps/aggregator/workflow.xml
examples/apps/aggregator/coordinator-with-offset.xml
examples/apps/java-main/job.properties
examples/apps/java-main/workflow.xml
examples/apps/custom-main/job.properties
examples/apps/custom-main/workflow.xml
examples/apps/custom-main/id.pig
examples/apps/ssh/job.properties
examples/apps/ssh/workflow.xml
examples/apps/sqoop-freeform/job.properties
examples/apps/sqoop-freeform/workflow.xml
examples/apps/sqoop-freeform/db.hsqldb.script
examples/apps/sqoop-freeform/db.hsqldb.properties
examples/apps/distcp/job.properties
examples/apps/distcp/workflow.xml
examples/apps/shell/job.properties
examples/apps/shell/workflow.xml
examples/apps/streaming/job.properties
examples/apps/streaming/workflow.xml
examples/apps/hcatalog/job.properties
examples/apps/hcatalog/coordinator.xml
examples/apps/hcatalog/workflow.xml
examples/apps/hcatalog/id.pig
examples/apps/hcatalog/README
examples/apps/bundle/job.properties
examples/apps/bundle/bundle.xml
examples/apps/datelist-java-main/job.properties
examples/apps/datelist-java-main/workflow.xml
examples/apps/no-op/job.properties
examples/apps/no-op/workflow.xml
examples/apps/hive/job.properties
examples/apps/hive/workflow.xml
examples/apps/hive/script.q
examples/apps/sla/job.properties
examples/apps/sla/coordinator.xml
examples/apps/sla/workflow.xml
examples/apps/subwf/job.properties
examples/apps/subwf/workflow.xml
examples/apps/demo/job.properties
examples/apps/demo/workflow.xml
examples/apps/demo/id.pig
examples/apps/sqoop/job.properties
examples/apps/sqoop/workflow.xml
examples/apps/sqoop/db.hsqldb.script
examples/apps/sqoop/db.hsqldb.properties
examples/apps/map-reduce/job.properties
examples/apps/map-reduce/workflow.xml
examples/apps/cron/job.properties
examples/apps/cron/coordinator.xml
examples/apps/cron/workflow.xml
examples/apps/hadoop-el/job.properties
examples/apps/hadoop-el/workflow.xml
examples/input-data/text/data.txt
examples/input-data/rawLogs/2010/01/01/00/20/log01.txt
examples/input-data/rawLogs/2010/01/01/00/20/_SUCCESS
examples/input-data/rawLogs/2010/01/01/00/40/log02.txt
examples/input-data/rawLogs/2010/01/01/00/40/_SUCCESS
examples/input-data/rawLogs/2010/01/01/01/00/log03.txt
examples/input-data/rawLogs/2010/01/01/01/00/_SUCCESS
examples/input-data/rawLogs/2010/01/01/01/20/log04.txt
examples/input-data/rawLogs/2010/01/01/01/20/_SUCCESS
examples/input-data/rawLogs/2010/01/01/01/40/log05.txt
examples/input-data/rawLogs/2010/01/01/01/40/_SUCCESS
examples/input-data/rawLogs/2010/01/01/02/00/log06.txt
examples/input-data/rawLogs/2010/01/01/02/00/_SUCCESS
examples/apps/aggregator/lib/oozie-examples-4.0.0.jar
examples/apps/custom-main/lib/oozie-examples-4.0.0.jar
examples/apps/demo/lib/oozie-examples-4.0.0.jar
examples/apps/hadoop-el/lib/oozie-examples-4.0.0.jar
examples/apps/java-main/lib/oozie-examples-4.0.0.jar
examples/apps/datelist-java-main/lib/oozie-examples-4.0.0.jar
examples/apps/map-reduce/lib/oozie-examples-4.0.0.jar

编辑/opt/oozie-4.0.0/examples/apps/map-reduce/job.properties文件

nameNode=hdfs://master:9000
jobTracker=master:8032
queueName=default
examplesRoot=examples

oozie.wf.application.path=${nameNode}/user/${user.name}/${examplesRoot}/apps/map-reduce
outputDir=map-reduce

这里特别要注意nameNode=hdfs://master:9000和jobTracker=master:8032的配置,否则运行后面的例子将会出错

上传examples目录到hdfs文件系统中

scott@master:/opt/oozie-4.0.0$ hdfs dfs -put examples examples

检查hdfs文件系统上的内容

scott@master:/opt/oozie-4.0.0$ hdfs dfs -ls -R examples
drwxr-xr-x - scott supergroup 0 2014-04-14 17:14 examples/apps
drwxr-xr-x - scott supergroup 0 2014-04-14 17:14 examples/apps/aggregator
-rw-r--r-- 1 scott supergroup 3466 2014-04-14 17:14 examples/apps/aggregator/coordinator-with-offset.xml
-rw-r--r-- 1 scott supergroup 3064 2014-04-14 17:14 examples/apps/aggregator/coordinator.xml
-rw-r--r-- 1 scott supergroup 1055 2014-04-14 17:14 examples/apps/aggregator/job-with-offset.properties
-rw-r--r-- 1 scott supergroup 1045 2014-04-14 17:14 examples/apps/aggregator/job.properties
drwxr-xr-x - scott supergroup 0 2014-04-14 17:14 examples/apps/aggregator/lib
-rw-r--r-- 1 scott supergroup 15654 2014-04-14 17:14 examples/apps/aggregator/lib/oozie-examples-4.0.0.jar
-rw-r--r-- 1 scott supergroup 2424 2014-04-14 17:14 examples/apps/aggregator/workflow.xml
drwxr-xr-x - scott supergroup 0 2014-04-14 17:14 examples/apps/bundle
-rw-r--r-- 1 scott supergroup 1482 2014-04-14 17:14 examples/apps/bundle/bundle.xml
-rw-r--r-- 1 scott supergroup 1062 2014-04-14 17:14 examples/apps/bundle/job.properties
drwxr-xr-x - scott supergroup 0 2014-04-14 17:14 examples/apps/cron
-rw-r--r-- 1 scott supergroup 1596 2014-04-14 17:14 examples/apps/cron/coordinator.xml
-rw-r--r-- 1 scott supergroup 1093 2014-04-14 17:14 examples/apps/cron/job.properties
-rw-r--r-- 1 scott supergroup 918 2014-04-14 17:14 examples/apps/cron/workflow.xml
drwxr-xr-x - scott supergroup 0 2014-04-14 17:14 examples/apps/custom-main
-rw-r--r-- 1 scott supergroup 930 2014-04-14 17:14 examples/apps/custom-main/id.pig
-rw-r--r-- 1 scott supergroup 1011 2014-04-14 17:14 examples/apps/custom-main/job.properties
drwxr-xr-x - scott supergroup 0 2014-04-14 17:14 examples/apps/custom-main/lib
-rw-r--r-- 1 scott supergroup 15654 2014-04-14 17:14 examples/apps/custom-main/lib/oozie-examples-4.0.0.jar
-rw-r--r-- 1 scott supergroup 4283 2014-04-14 17:14 examples/apps/custom-main/workflow.xml
drwxr-xr-x - scott supergroup 0 2014-04-14 17:14 examples/apps/datelist-java-main
-rw-r--r-- 1 scott supergroup 1137 2014-04-14 17:14 examples/apps/datelist-java-main/job.properties
drwxr-xr-x - scott supergroup 0 2014-04-14 17:14 examples/apps/datelist-java-main/lib
-rw-r--r-- 1 scott supergroup 15654 2014-04-14 17:14 examples/apps/datelist-java-main/lib/oozie-examples-4.0.0.jar
-rw-r--r-- 1 scott supergroup 1991 2014-04-14 17:14 examples/apps/datelist-java-main/workflow.xml
drwxr-xr-x - scott supergroup 0 2014-04-14 17:14 examples/apps/demo
-rw-r--r-- 1 scott supergroup 930 2014-04-14 17:14 examples/apps/demo/id.pig
-rw-r--r-- 1 scott supergroup 1003 2014-04-14 17:14 examples/apps/demo/job.properties
drwxr-xr-x - scott supergroup 0 2014-04-14 17:14 examples/apps/demo/lib
-rw-r--r-- 1 scott supergroup 15654 2014-04-14 17:14 examples/apps/demo/lib/oozie-examples-4.0.0.jar
-rw-r--r-- 1 scott supergroup 6136 2014-04-14 17:14 examples/apps/demo/workflow.xml
drwxr-xr-x - scott supergroup 0 2014-04-14 17:14 examples/apps/distcp
-rw-r--r-- 1 scott supergroup 1021 2014-04-14 17:14 examples/apps/distcp/job.properties
-rw-r--r-- 1 scott supergroup 1890 2014-04-14 17:14 examples/apps/distcp/workflow.xml
drwxr-xr-x - scott supergroup 0 2014-04-14 17:14 examples/apps/hadoop-el
-rw-r--r-- 1 scott supergroup 977 2014-04-14 17:14 examples/apps/hadoop-el/job.properties
drwxr-xr-x - scott supergroup 0 2014-04-14 17:14 examples/apps/hadoop-el/lib
-rw-r--r-- 1 scott supergroup 15654 2014-04-14 17:14 examples/apps/hadoop-el/lib/oozie-examples-4.0.0.jar
-rw-r--r-- 1 scott supergroup 3008 2014-04-14 17:14 examples/apps/hadoop-el/workflow.xml
drwxr-xr-x - scott supergroup 0 2014-04-14 17:14 examples/apps/hcatalog
-rw-r--r-- 1 scott supergroup 1386 2014-04-14 17:14 examples/apps/hcatalog/README
-rw-r--r-- 1 scott supergroup 3075 2014-04-14 17:14 examples/apps/hcatalog/coordinator.xml
-rw-r--r-- 1 scott supergroup 1032 2014-04-14 17:14 examples/apps/hcatalog/id.pig
-rw-r--r-- 1 scott supergroup 1203 2014-04-14 17:14 examples/apps/hcatalog/job.properties
-rw-r--r-- 1 scott supergroup 1992 2014-04-14 17:14 examples/apps/hcatalog/workflow.xml
drwxr-xr-x - scott supergroup 0 2014-04-14 17:14 examples/apps/hive
-rw-r--r-- 1 scott supergroup 1000 2014-04-14 17:14 examples/apps/hive/job.properties
-rw-r--r-- 1 scott supergroup 939 2014-04-14 17:14 examples/apps/hive/script.q
-rw-r--r-- 1 scott supergroup 2003 2014-04-14 17:14 examples/apps/hive/workflow.xml
drwxr-xr-x - scott supergroup 0 2014-04-14 17:14 examples/apps/java-main
-rw-r--r-- 1 scott supergroup 977 2014-04-14 17:14 examples/apps/java-main/job.properties
drwxr-xr-x - scott supergroup 0 2014-04-14 17:14 examples/apps/java-main/lib
-rw-r--r-- 1 scott supergroup 15654 2014-04-14 17:14 examples/apps/java-main/lib/oozie-examples-4.0.0.jar
-rw-r--r-- 1 scott supergroup 1631 2014-04-14 17:14 examples/apps/java-main/workflow.xml
drwxr-xr-x - scott supergroup 0 2014-04-14 17:14 examples/apps/map-reduce
-rw-r--r-- 1 scott supergroup 999 2014-04-14 17:14 examples/apps/map-reduce/job.properties
drwxr-xr-x - scott supergroup 0 2014-04-14 17:14 examples/apps/map-reduce/lib
-rw-r--r-- 1 scott supergroup 15654 2014-04-14 17:14 examples/apps/map-reduce/lib/oozie-examples-4.0.0.jar
-rw-r--r-- 1 scott supergroup 2559 2014-04-14 17:14 examples/apps/map-reduce/workflow.xml
drwxr-xr-x - scott supergroup 0 2014-04-14 17:14 examples/apps/no-op
-rw-r--r-- 1 scott supergroup 973 2014-04-14 17:14 examples/apps/no-op/job.properties
-rw-r--r-- 1 scott supergroup 918 2014-04-14 17:14 examples/apps/no-op/workflow.xml
drwxr-xr-x - scott supergroup 0 2014-04-14 17:14 examples/apps/pig
-rw-r--r-- 1 scott supergroup 930 2014-04-14 17:14 examples/apps/pig/id.pig
-rw-r--r-- 1 scott supergroup 1002 2014-04-14 17:14 examples/apps/pig/job.properties
-rw-r--r-- 1 scott supergroup 1986 2014-04-14 17:14 examples/apps/pig/workflow.xml
drwxr-xr-x - scott supergroup 0 2014-04-14 17:14 examples/apps/shell
-rw-r--r-- 1 scott supergroup 971 2014-04-14 17:14 examples/apps/shell/job.properties
-rw-r--r-- 1 scott supergroup 2075 2014-04-14 17:14 examples/apps/shell/workflow.xml
drwxr-xr-x - scott supergroup 0 2014-04-14 17:14 examples/apps/sla
-rw-r--r-- 1 scott supergroup 3737 2014-04-14 17:14 examples/apps/sla/coordinator.xml
-rw-r--r-- 1 scott supergroup 1372 2014-04-14 17:14 examples/apps/sla/job.properties
-rw-r--r-- 1 scott supergroup 1418 2014-04-14 17:14 examples/apps/sla/workflow.xml
drwxr-xr-x - scott supergroup 0 2014-04-14 17:14 examples/apps/sqoop
-rw-r--r-- 1 scott supergroup 1208 2014-04-14 17:14 examples/apps/sqoop/db.hsqldb.properties
-rw-r--r-- 1 scott supergroup 1081 2014-04-14 17:14 examples/apps/sqoop/db.hsqldb.script
-rw-r--r-- 1 scott supergroup 1002 2014-04-14 17:14 examples/apps/sqoop/job.properties
-rw-r--r-- 1 scott supergroup 2085 2014-04-14 17:14 examples/apps/sqoop/workflow.xml
drwxr-xr-x - scott supergroup 0 2014-04-14 17:14 examples/apps/sqoop-freeform
-rw-r--r-- 1 scott supergroup 1208 2014-04-14 17:14 examples/apps/sqoop-freeform/db.hsqldb.properties
-rw-r--r-- 1 scott supergroup 1081 2014-04-14 17:14 examples/apps/sqoop-freeform/db.hsqldb.script
-rw-r--r-- 1 scott supergroup 1011 2014-04-14 17:14 examples/apps/sqoop-freeform/job.properties
-rw-r--r-- 1 scott supergroup 2508 2014-04-14 17:14 examples/apps/sqoop-freeform/workflow.xml
drwxr-xr-x - scott supergroup 0 2014-04-14 17:14 examples/apps/ssh
-rw-r--r-- 1 scott supergroup 969 2014-04-14 17:14 examples/apps/ssh/job.properties
-rw-r--r-- 1 scott supergroup 1311 2014-04-14 17:14 examples/apps/ssh/workflow.xml
drwxr-xr-x - scott supergroup 0 2014-04-14 17:14 examples/apps/streaming
-rw-r--r-- 1 scott supergroup 1008 2014-04-14 17:14 examples/apps/streaming/job.properties
-rw-r--r-- 1 scott supergroup 2208 2014-04-14 17:14 examples/apps/streaming/workflow.xml
drwxr-xr-x - scott supergroup 0 2014-04-14 17:14 examples/apps/subwf
-rw-r--r-- 1 scott supergroup 974 2014-04-14 17:14 examples/apps/subwf/job.properties
-rw-r--r-- 1 scott supergroup 2097 2014-04-14 17:14 examples/apps/subwf/workflow.xml
drwxr-xr-x - scott supergroup 0 2014-04-14 17:14 examples/input-data
drwxr-xr-x - scott supergroup 0 2014-04-14 17:14 examples/input-data/rawLogs
drwxr-xr-x - scott supergroup 0 2014-04-14 17:14 examples/input-data/rawLogs/2010
drwxr-xr-x - scott supergroup 0 2014-04-14 17:14 examples/input-data/rawLogs/2010/01
drwxr-xr-x - scott supergroup 0 2014-04-14 17:14 examples/input-data/rawLogs/2010/01/01
drwxr-xr-x - scott supergroup 0 2014-04-14 17:14 examples/input-data/rawLogs/2010/01/01/00
drwxr-xr-x - scott supergroup 0 2014-04-14 17:14 examples/input-data/rawLogs/2010/01/01/00/20
-rw-r--r-- 1 scott supergroup 2 2014-04-14 17:14 examples/input-data/rawLogs/2010/01/01/00/20/_SUCCESS
-rw-r--r-- 1 scott supergroup 15 2014-04-14 17:14 examples/input-data/rawLogs/2010/01/01/00/20/log01.txt
drwxr-xr-x - scott supergroup 0 2014-04-14 17:14 examples/input-data/rawLogs/2010/01/01/00/40
-rw-r--r-- 1 scott supergroup 2 2014-04-14 17:14 examples/input-data/rawLogs/2010/01/01/00/40/_SUCCESS
-rw-r--r-- 1 scott supergroup 15 2014-04-14 17:14 examples/input-data/rawLogs/2010/01/01/00/40/log02.txt
drwxr-xr-x - scott supergroup 0 2014-04-14 17:14 examples/input-data/rawLogs/2010/01/01/01
drwxr-xr-x - scott supergroup 0 2014-04-14 17:14 examples/input-data/rawLogs/2010/01/01/01/00
-rw-r--r-- 1 scott supergroup 2 2014-04-14 17:14 examples/input-data/rawLogs/2010/01/01/01/00/_SUCCESS
-rw-r--r-- 1 scott supergroup 15 2014-04-14 17:14 examples/input-data/rawLogs/2010/01/01/01/00/log03.txt
drwxr-xr-x - scott supergroup 0 2014-04-14 17:14 examples/input-data/rawLogs/2010/01/01/01/20
-rw-r--r-- 1 scott supergroup 2 2014-04-14 17:14 examples/input-data/rawLogs/2010/01/01/01/20/_SUCCESS
-rw-r--r-- 1 scott supergroup 15 2014-04-14 17:14 examples/input-data/rawLogs/2010/01/01/01/20/log04.txt
drwxr-xr-x - scott supergroup 0 2014-04-14 17:14 examples/input-data/rawLogs/2010/01/01/01/40
-rw-r--r-- 1 scott supergroup 2 2014-04-14 17:14 examples/input-data/rawLogs/2010/01/01/01/40/_SUCCESS
-rw-r--r-- 1 scott supergroup 15 2014-04-14 17:14 examples/input-data/rawLogs/2010/01/01/01/40/log05.txt
drwxr-xr-x - scott supergroup 0 2014-04-14 17:14 examples/input-data/rawLogs/2010/01/01/02
drwxr-xr-x - scott supergroup 0 2014-04-14 17:14 examples/input-data/rawLogs/2010/01/01/02/00
-rw-r--r-- 1 scott supergroup 2 2014-04-14 17:14 examples/input-data/rawLogs/2010/01/01/02/00/_SUCCESS
-rw-r--r-- 1 scott supergroup 15 2014-04-14 17:14 examples/input-data/rawLogs/2010/01/01/02/00/log06.txt
drwxr-xr-x - scott supergroup 0 2014-04-14 17:14 examples/input-data/text
-rw-r--r-- 1 scott supergroup 1409 2014-04-14 17:14 examples/input-data/text/data.txt
drwxr-xr-x - scott supergroup 0 2014-04-14 17:14 examples/src
drwxr-xr-x - scott supergroup 0 2014-04-14 17:14 examples/src/org
drwxr-xr-x - scott supergroup 0 2014-04-14 17:14 examples/src/org/apache
drwxr-xr-x - scott supergroup 0 2014-04-14 17:14 examples/src/org/apache/oozie
drwxr-xr-x - scott supergroup 0 2014-04-14 17:14 examples/src/org/apache/oozie/example
-rw-r--r-- 1 scott supergroup 3385 2014-04-14 17:14 examples/src/org/apache/oozie/example/DateList.java
-rw-r--r-- 1 scott supergroup 1157 2014-04-14 17:14 examples/src/org/apache/oozie/example/DemoJavaMain.java
-rw-r--r-- 1 scott supergroup 956 2014-04-14 17:14 examples/src/org/apache/oozie/example/DemoMapReduceMain.java
-rw-r--r-- 1 scott supergroup 2030 2014-04-14 17:14 examples/src/org/apache/oozie/example/DemoMapper.java
-rw-r--r-- 1 scott supergroup 938 2014-04-14 17:14 examples/src/org/apache/oozie/example/DemoPigMain.java
-rw-r--r-- 1 scott supergroup 1733 2014-04-14 17:14 examples/src/org/apache/oozie/example/DemoReducer.java
-rw-r--r-- 1 scott supergroup 4391 2014-04-14 17:14 examples/src/org/apache/oozie/example/LocalOozieExample.java
-rw-r--r-- 1 scott supergroup 5763 2014-04-14 17:14 examples/src/org/apache/oozie/example/Repeatable.java
-rw-r--r-- 1 scott supergroup 1511 2014-04-14 17:14 examples/src/org/apache/oozie/example/SampleMapper.java
-rw-r--r-- 1 scott supergroup 1612 2014-04-14 17:14 examples/src/org/apache/oozie/example/SampleReducer.java
-rw-r--r-- 1 scott supergroup 1198 2014-04-14 17:14 examples/src/org/apache/oozie/example/TimeUnit.java

开启oozie job

scott@master:/opt/oozie-4.0.0$ bin/oozie job -oozie http://master:11000/oozie -config examples/apps/map-reduce/job.properties -run
job: 0000000-140414170533374-oozie-scot-W

检查job状态

scott@master:/opt/oozie-4.0.0$ bin/oozie job -oozie http://master:11000/oozie -info 0000000-140414170533374-oozie-scot-W
Job ID : 0000000-140414170533374-oozie-scot-W
------------------------------------------------------------------------------------------------------------------------------------
Workflow Name : map-reduce-wf
App Path : hdfs://master:9000/user/scott/examples/apps/map-reduce
Status : RUNNING
Run : 0
User : scott
Group : -
Created : 2014-04-14 09:19 GMT
Started : 2014-04-14 09:19 GMT
Last Modified : 2014-04-14 09:19 GMT
Ended : -
CoordAction ID: -

Actions
------------------------------------------------------------------------------------------------------------------------------------
ID Status Ext ID Ext Status Err Code
------------------------------------------------------------------------------------------------------------------------------------
0000000-140414170533374-oozie-scot-W@:start: OK - OK -
------------------------------------------------------------------------------------------------------------------------------------
0000000-140414170533374-oozie-scot-W@mr-node RUNNING job_1397455663398_0003 RUNNING -
------------------------------------------------------------------------------------------------------------------------------------

等运行完再次检查

scott@master:/opt/oozie-4.0.0$ bin/oozie job -oozie http://master:11000/oozie -info 0000000-140414170533374-oozie-scot-W
Job ID : 0000000-140414170533374-oozie-scot-W
------------------------------------------------------------------------------------------------------------------------------------
Workflow Name : map-reduce-wf
App Path : hdfs://master:9000/user/scott/examples/apps/map-reduce
Status : KILLED
Run : 0
User : scott
Group : -
Created : 2014-04-14 09:19 GMT
Started : 2014-04-14 09:19 GMT
Last Modified : 2014-04-14 09:51 GMT
Ended : 2014-04-14 09:51 GMT
CoordAction ID: -

Actions
------------------------------------------------------------------------------------------------------------------------------------
ID Status Ext ID Ext Status Err Code
------------------------------------------------------------------------------------------------------------------------------------
0000000-140414170533374-oozie-scot-W@:start: OK - OK -
------------------------------------------------------------------------------------------------------------------------------------
0000000-140414170533374-oozie-scot-W@mr-node OK job_1397455663398_0003 FAILED/KILLED-
------------------------------------------------------------------------------------------------------------------------------------
0000000-140414170533374-oozie-scot-W@fail OK - OK E0729
------------------------------------------------------------------------------------------------------------------------------------

检查hdfs文件系统(即该job运行后的输出结果)

scott@master:/opt/oozie-4.0.0$ hdfs dfs -cat examples/output-data/map-reduce/*
0 To be or not to be, that is the question;
42 Whether 'tis nobler in the mind to suffer
84 The slings and arrows of outrageous fortune,
129 Or to take arms against a sea of troubles,
172 And by opposing, end them. To die, to sleep;
217 No more; and by a sleep to say we end
255 The heart-ache and the thousand natural shocks
302 That flesh is heir to ? 'tis a consummation
346 Devoutly to be wish'd. To die, to sleep;
387 To sleep, perchance to dream. Ay, there's the rub,
438 For in that sleep of death what dreams may come,
487 When we have shuffled off this mortal coil,
531 Must give us pause. There's the respect
571 That makes calamity of so long life,
608 For who would bear the whips and scorns of time,
657 Th'oppressor's wrong, the proud man's contumely,
706 The pangs of despised love, the law's delay,
751 The insolence of office, and the spurns
791 That patient merit of th'unworthy takes,
832 When he himself might his quietus make
871 With a bare bodkin? who would fardels bear,
915 To grunt and sweat under a weary life,
954 But that the dread of something after death,
999 The undiscovered country from whose bourn
1041 No traveller returns, puzzles the will,
1081 And makes us rather bear those ills we have
1125 Than fly to others that we know not of?
1165 Thus conscience does make cowards of us all,
1210 And thus the native hue of resolution
1248 Is sicklied o'er with the pale cast of thought,
1296 And enterprises of great pitch and moment
1338 With this regard their currents turn awry,
1381 And lose the name of action.

示例截图

Oozie WorkflowJobs

Oozie Sysinfo

Job Info

Job Definition

Job Configuration

Job Log

Job DAG

参考文档

http://stackoverflow.com/questions/22077120/install-oozie-on-hadoop-2-2
https://oozie.apache.org/docs/4.0.0/index.html
http://oozie.apache.org/docs/4.0.0/DG_QuickStart.html
http://oozie.apache.org/docs/4.0.0/DG_Examples.html
http://www.hadoopinrealworld.com/building-running-and-testing-apache-oozie-4-0-0-2/
http://www.thecloudavenue.com/2013/10/installation-and-configuration-of.html
http://www.apache.org/dyn/closer.cgi/oozie/4.0.0