1. 程式人生 > >大數據平臺搭建 - cdh5.11.1 - oozie安裝

大數據平臺搭建 - cdh5.11.1 - oozie安裝

val 5.1 bpa property 版本 hba 大數據 當前目錄 生效

一、簡介

oozie是hadoop平臺開源的工作流調度引擎,用來管理hadoop作業,屬於web應用程序,由oozie server 和oozie client構成。

oozie server運行與tomcat容器中

oozie的工作流必須是一個有向無環圖,當用戶需要執行多個關聯的MapReduce作業時,只需要把作業寫進workflow.xml中,再提交到oozie,oozie便可以托管服務,按照預先的配置有序執行任務。

二、安裝

1.下載編譯好的cdh版本

http://archive.cloudera.com/cdh5/cdh/5/

下載4.1-cdh5.11.1即可

2.先停hbase和zookeeper

bin/hbase-daemon.sh stop master bin/hbase-daemon.sh stop regionserver bin/hbase-daemon.sh stop zookeeper 3.再停hadoop集群 sbin/stop-dfs.sh sbin/stop-yarn.sh 4.解壓oozie壓縮包到本地目錄 5.配置hadoop的一個代理用戶
<!-- OOZIE -->
<property>
<name>hadoop.proxyuser.hadoop.hosts</name>
<value>hadoop001</value>
</property>
<property>
<name>hadoop.proxyuser.hadoop.groups</name>
<value>*</value>
</property>

 

6.在解壓過的根目錄中,再解壓oozie-hadooplibs-4.0.0-cdh5.3.6.tar.gz文件到當前目錄下,會多一個目錄:oozie-4.1.0-cdh5.11.1目錄

7.在oozie根目錄下創建libext目錄

拷貝剛剛解壓的jar包到libext目錄

cp -r ./oozie-4.1.0-cdh5.11.1/hadooplibs/hadooplib-2.6.0-cdh5.11.1.oozie-4.1.0-cdh5.11.1/* ~/app/oozie/libext/

8.拷貝ext-2.2.zip到libext目錄

9.打包oozie到war包中

bin/oozie-setup.sh prepare-war



這個命令會把libext下的jar包,打成war包

10.啟動hadoop

sbin/start-dfs.sh

sbin/start-yarn.sh

11.修改oozie-site.xml,新增配置(在oozie新版本中,會有oozie-default.xml和oozie-site.xml,如果有修改的地方,請拷貝屬性到oozie-site.xml中,不要直接去修改oozie-default.xml否則不生效)



	<property>
        <name>oozie.service.WorkflowAppService.system.libpath</name>
        <value>/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>
	

	<property>
        <name>oozie.service.HadoopAccessorService.hadoop.configurations</name>
        <value>*=/home/hadoop/app/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>

  


  12.把共享包傳到hdfs上

bin/oozie-setup.sh sharelib create -fs hdfs://hadoop004:8020 -locallib oozie-sharelib-4.1.0-cdh5.11.1-yarn.tar.gz
13.配置oozie的數據庫為mysql
oozie-site.xml新加配置



<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://hadoop001:3306/oozie?createDatabaseIfNotExist=true</value>
        <description>
            JDBC URL.
        </description>
    </property>

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

    <property>
        <name>oozie.service.JPAService.jdbc.password</name>
        <value>123456</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>

  

 

利用命令在數據庫中創建表結構及數據

bin/ooziedb.sh create -sqlfile oozie.sql -run DB Connection

14.啟動oozie

bin/oozied.sh start

15.訪問:

hadoop001:11000 即可訪問了

大數據平臺搭建 - cdh5.11.1 - oozie安裝