九、配置conf/oozie-site.xml文件
主要是配置数据库保存源文件。
[Hadoop@fa01 conf]$ vim oozie-site.xml
在文件底部添加下面这些内容:
<property>
<name>oozie.db.schema.name</name>
<value>oozie</value>
<description>
Oozie DataBase Name
</description>
</property>
<property>
<name>oozie.service.JPAService.create.db.schema</name>
<value>false</value>
<description>
Creates Oozie DB.
If set to true, it creates the DB schema if it does not exist. If the DB schema exists is a NOP.
If set to false, it does not create the DB schema. If the DB schema does not exist it fails start up.
</description>
</property>
<property>
<name>oozie.service.JPAService.jdbc.driver</name>
<value>com.mysql.jdbc.Driver</value>
<description>
JDBC driver class.
</description>
</property>
<property>
<name>oozie.service.JPAService.jdbc.url</name>
<value>jdbc:mysql://192.168.20.32:3306/oozie?createDatabaseIfNotExist=true</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>mysql</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.
</description>
</property>
<property>
<name>oozie.service.HadoopAccessorService.hadoop.configurations</name>
<value>*=/home/hadoop/hadoop-2.6.0-cdh5.5.2/etc/hadoop</value>
<description>
Comma separated AUTHORITY=HADOOP_CONF_DIR, where AUTHORITY is the HOST:PORT of
the Hadoop service (JobTracker, 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>
同时,要在MySQL中,创建好用户名和密码。
mysql> create user 'oozie' identified by 'mysql';
mysql> grant all privileges on *.* to 'oozie'@'%' with grant option;
由于版本5不识别%,所以需要重新声明一下主机的地址
mysql> grant all privileges on *.* to oozie@fa01 identified by 'mysql';
mysql> flush privileges;
十、在hdfs上创建包
[hadoop@fa01 oozie-4.1.0-cdh5.5.2]$ pwd
/home/hadoop/oozie-4.1.0-cdh5.5.2
[hadoop@fa01 oozie-4.1.0-cdh5.5.2]$ bin/oozie-setup.sh sharelib create -fs hdfs://192.168.20.32:9000 -locallib oozie-sharelib-4.1.0-cdh5.5.2-yarn.tar.gz
十一、给oozie-server赋予权限
[hadoop@fa01 oozie-4.1.0-cdh5.5.2]$ chmod 777 oozie-server -R
[hadoop@fa01 libext]$ chmod 777 ext-2.2 -R
十二、创建数据库脚本,并初始化数据库
[hadoop@fa01 oozie-4.1.0-cdh5.5.2]$ bin/ooziedb.sh create -sqlfile oozie.sql -run DB Connection
之后的显示:
十三、开启oozie的实例
[hadoop@fa01 oozie-4.1.0-cdh5.5.2]$ bin/oozied.sh start
十四、运行oozie
[hadoop@fa01 oozie-4.1.0-cdh5.5.2]$ bin/oozied.sh run &
十五、测试、查看
jps一下,出现Bootstrap就对了三分之一。
继续:出现NORMAL就对了三分之二。
[hadoop@fa01 oozie-4.1.0-cdh5.5.2]$ bin/oozie admin -oozie http://192.168.20.32:11000/oozie -status
System mode: NORMAL
再继续:
登录页面http://192.168.20.32:11000/oozie/,可以正常显示如下页面,就百分之百了。
本文永久更新链接地址:http://www.linuxidc.com/Linux/2017-10/147655.htm