首页 oozie安装指南
文章
取消

oozie安装指南

安装环境

  • ubuntu-18.04

  • jdk-1.8.0_261

  • hadoop-2.10.0

  • maven-3.6.3

  • hbase-1.6.0

  • sqoop-2.6.0

下载 oozie

oozie 官网 下载所需要版本的 oozie 源码包,解压到 /usr/local/src 文件夹中。因为官方只提供了源代码,所以需要自行编译 oozie 。

编译 oozie

最简单的方式是用自带的脚本编译,建议使用国内的 maven 源,中央仓库的太慢了。这里之前指定了 hive 的版本,但是编译一直不通过,去掉了之后就可以正常编译了。

1
bin/mkdistro.sh -DskipTests -Dhadoop.version=2.10.0 -Dsqoop.version=1.4.7 -Dhbase.version=1.6.0

安装 oozie

将编译好的包解压到 /usr/local 文件夹中,需要在 ~/.bashrc 中设置环境变量。

1
2
3
4
5
6
tar zxvf distro/target/oozie-5.2.0-distro.tar.gz -C /usr/local/oozie

# set oozie home
export HADOOP_HOME=/usr/local/hadoop
export HADOOP_CONF_DIR=$HADOOP_HOME/etc/hadoop
export PATH=$HADOOP_HOME/bin:$PATH

修改 oozie 配置文件

core-site.xml

需要在 hadoop 设置文件 core-site.xml 中增加以下配置:

1
2
3
4
5
6
7
8
  <property>
    <name>hadoop.proxyuser.qzp.hosts</name>
    <value>*</value>
  </property>
  <property>
    <name>hadoop.proxyuser.qzp.groups</name>
    <value>*</value>
  </property>

oozie-site.xml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
    <property>
        <name>oozie.service.JPAService.jdbc.driver</name>
        <value>com.mysql.cj.jdbc.Driver</value>
        <description>
            JDBC driver class.
        </description>
    </property>

    <property>
        <name>oozie.service.JPAService.jdbc.url</name>
        <value>jdbc:mysql://10.168.1.111:3306/oozie?serverTimezone=Asia/Shanghai</value>
        <description>
            JDBC URL.
        </description>
    </property>

    <property>
        <name>oozie.service.JPAService.jdbc.username</name>
        <value>oozie</value>
        <description>
            DB user name.
        </description>
    </property>

    <property>
        <name>oozie.service.JPAService.jdbc.password</name>
        <value>oozie</value>
        <description>
            DB user password.

            IMPORTANT: if password is emtpy leave a 1 space string, the service trims the value,
                       if empty Configuration assumes it is NULL.

            IMPORTANT: if the StoreServicePasswordService is active, it will reset this value with the value given in
                       the console.
        </description>
    </property>

    <property>
        <name>oozie.service.HadoopAccessorService.hadoop.configurations</name>
        <value>*=/usr/local/hadoop/etc/hadoop/</value>
        <description>
            Comma separated AUTHORITY=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 for an 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 in the local filesystem.
        </description>
    </property>

    <property>
        <name>oozie.service.WorkflowAppService.system.libpath</name>
        <value>hdfs://localhost:9000/user/oozie/share/lib</value>
        <description>
            System library path to use for workflow applications.
            This path is added to workflow application if their job properties sets
            the property 'oozie.use.system.libpath' to true.
        </description>
    </property>

复制 jar 包

需要在家目录下创建 libext 文件夹,放入 mysql 的驱动包和 [ExtJS 2.2](http://archive.cloudera.com/gplextras/misc/ext-2.2.zip) 的安装包。还需要将 hadoop 文件夹下 lib 目录中的文件拷贝到 libext 文件夹中。在实际初始化 mysql 数据库的时候还有许多 oozie 自带的包找不到,然后又挨个把 oozie 文件夹里面的 jar 包都拷贝到了 lib 目录下命令才正常执行。

设置 mysql 数据库

1
2
3
CREATE DATABASE oozie;
CREATE USER oozie IDENTIFIED BY 'oozie';
GRANT ALL PRIVILEGES ON oozie.* TO 'oozie'@'%';

初始化元数据库:

1
bin/ooziedb.sh create -sqlfile oozie.sql -run

启动 oozie

1
bin/oozie-start.sh

sudo cp -rfv /usr/local/hadoop/share/hadoop//.jar /usr/local/oozie/libext sudo cp -rfv /usr/local/hadoop/share/hadoop//lib/.jar /usr/local/oozie/libext

https://www.soinside.com/question/j4Y92v4zoR48rLTjcfZFkd https://blog.csdn.net/L_15156024189/article/details/106854006#oozie%E5%AE%89%E8%A3%85 https://www.jianshu.com/p/6e2f6b4517f0

oozie-setup.sh sharelib create -fs /user/root/share/lib -locallib oozie-sharelib-5.2.0.tar.gz

./bin/mkdistro.sh -Dhadoop.version=2.10.0 -Dsqoop.version=1.4.7 -Dhive.version=2.3.7 -Dhbase.version=1.6.0 -DskipTests ./bin/mkdistro.sh -Dhadoop.version=2.10.0 -Dhive.version=2.3.7 -DskipTests

./bin/mkdistro.sh -Dhadoop.version=2.10.0 -Dsqoop.version=1.4.7 -DskipTests

./bin/mkdistro.sh -DskipTests -Dhadoop.version=2.10.0 -Dsqoop.version=1.4.7 -Dhbase.version=1.6.0

./bin/mkdistro.sh -Dhadoop.version=2.10.0 -DskipTests

本文由作者按照 CC BY 4.0 进行授权