oozie4.1环境搭建

来源:互联网 发布:python 获取交易日 编辑:程序博客网 时间:2024/04/30 06:23

1)、配置环境变量:

  export OOZIE_HOME=/home/hadoop/CDH5/oozie-4.1.0-cdh5.4.8

  export OOZIE_CONFIG=$OOZIE_HOME/conf 

2)、修改conf/oozie-site.xml
<!--是否自动创建数据库-->
<property>
<name>oozie.service.JPAService.create.db.schema</name>
<value>true</value>
</property>
<property>
<name>oozie.service.JPAService.jdbc.driver</name>
<value>com.mysql.jdbc.Driver</value>
</property>
<property>
<name>oozie.service.JPAService.jdbc.url</name>
<value>jdbc:mysql://192.168.0.208: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>root</value>
</property>
<!--以下配置项,将值指向真实hadoop配置文件路径,实现oozie和hadoop的关联-->
<property>
<name>oozie.service.HadoopAccessorService.hadoop.configurations</name>
<value>*=/home/hadoop/hadoop2/program/hadoop/etc/hadoop</value>
</property>
<!--配置用户组-->
<property>
<name>hadoop.proxyuser.oozie.hosts</name>
<value>hadoop</value>
</property>
<property>
<name>hadoop.proxyuser.oozie.groups</name>
<value>hadoop</value>
</property>

<!--设置Spark的配置文件的路径-->
<!--<property>
<name>oozie.service.SparkConfigurationService.spark.configurations</name>
<value>*=/home/hadoop/hadoop2/program/spark/conf</value>
<description>
Comma separated AUTHORITY=SPARK_CONF_DIR, where AUTHORITY is the HOST:PORT of
the ResourceManager of a YARN cluster. The wildcard '*' configuration is
used when there is no exact match for an authority. The SPARK_CONF_DIR contains
the relevant spark-defaults.conf properties file. If the path is relative is looked within
the Oozie configuration directory; though the path can be absolute.  This is only used
when the Spark master is set to either "yarn-client" or "yarn-cluster".
</description>
</property>-->
<!--
设置系统库存放在hdfs中,注意只有在job.properties中将设置oozie.use.system.libpath=true才会引用系统库
。注意,下面ns1是namenode的逻辑名称,根据自己集群的情况进行更改即可-->
<property>
<name>oozie.service.WorkflowAppService.system.libpath</name>
<value>hdfs://ns1/user/${user.name}/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>
3)、修改$HADOOP_HOME/etc/core-site.xml
   <property>
   <name>hadoop.proxyuser.hadoop.hosts</name>
   <value>master</value>
   </property>
   <property>
   <name>hadoop.proxyuser.hadoop.groups</name>
   <value>hadoop</value>
   </property>
4)、添加JDBC驱动(/libtools)
      添加hive-hbase-handler-1.1.0-cdh5.4.8.jar、hbase-common-1.0.0-cdh5.4.8.jar、hbase-server-1.0.0-cdh5.4.8.jar、
      hbase-protocol-1.0.0-cdh5.4.8.jar、hbase-client-1.0.0-cdh5.4.8.jar、hbase-hadoop-compat-1.0.0-cdh5.4.8.jar、
       htrace-core-3.1.0-incubating.jar包至libtools和hdfs://usr/hadoop/share/libXXXX/hive
      添加hbase-site.xml修改action-conf/hive.xml、hadoop-conf/core-site.xml
5)、添加ext包(部署: bin/oozie-setup.sh prepare-war)
      执 行下面的命令,将ext2.2.0.zip、hadoop的相关jar包、以及mysql-connector-java-<版 本>.jar、htrace-core-<版本      
      >.jar、avro-<版本>.jar 打进新war包里:
     bin/addtowar.sh -inputwar oozie.war  -outputwar oozie-server/webapps/oozie.war -hadoop 2.6.0 /opt/hadoop-2.6.0/ -extjs libext/ext-2.2.zip -jars /opt/oozie-4.2.0/libext/mysql-connector-java-5.1.35.jar:/opt/oozie-4.2.0/libext/htrace-core-3.0.4.jar:/opt/oozie-4.2.0/libext/avro-1.7.4.jar
     注意:
     1) htrace-core和avro这两个jar包不加的话,后面提交job时会出错!并且执行了上面这句后,
      就不能再执行bin/oozie- setup.sh prepare-war 了,否则替换掉oozie-server/webapps/中已经生成的oozie.war
     2)在ubuntu上执行上面命令时遇到zip:command not found;Failed:Creating new Oozie WAR的问题。
      这是因为没有安装Zip导致的。装上即可。
6)、执行以下命令创建并执行sql脚本初始化数据库
./ooziedb.sh create -sqlfile oozie.sql
7)、在hdfs添加sharelib
./oozie-setup.sh sharelib create -fs hdfs://master:8020(hdfs://ns1) -locallib /home/hadoop/local/oozie-4.0.0-cdh5.0.1/oozie-sharelib-4.0.0-cdh5.0.1-yarn.tar.gz
8)、启动jobhistoryserver ./mr-jobhistory-daemon.sh start historyserver
    yurn-site.xml添加
<property>
<name>mapred.job.history.server.embedded</name>
<value>true</value>
</property>
<property>
<name>mapreduce.jobhistory.address</name>
<value>customercenter3:10020</value>
</property>
<property>
<name>mapreduce.jobhistory.webapp.address</name>
<value> customercenter3:19888</value>
</property>
    <!-- 开启job history server-->
   启动oozie ./oozied.sh start
9)、访问http://localhost:11000/oozie/

 
0 0
原创粉丝点击