ssslinppp

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

安装和配置Oozie

Oozie用于Hadoop的工作流配置;

参考链接:
《Install and Configure Apache Oozie Workflow Scheduler for CDH 4.X on RHEL/CentOS 6/5》
《How to Install Latest MySQL 5.7.9 on RHEL/CentOS 7/6/5 and Fedora 23/22/21》
主要内容:
  • 步骤1:安装Oozie
  • 步骤2:配置Oozie

安装Oozie

  1. wget http://archive.cloudera.com/cdh4/one-click-install/redhat/6/x86_64/cloudera-cdh-4-0.x86_64.rpm
  2. yum --nogpgcheck localinstall cloudera-cdh-4-0.x86_64.rpm
  3. yum install oozie
  4. yum install oozie-client

配置Oozie


首先安装Mysql,可参考:
《How to Install Latest MySQL 5.7.9 on RHEL/CentOS 7/6/5 and Fedora 23/22/21》
注意点:执行 mysql_secure_installation时,应该先关闭Mysql,否则报错;
安装步骤:
  1. wget http://dev.mysql.com/get/mysql57-community-release-el6-7.noarch.rpm
  2. yum localinstall mysql57-community-release-el6-7.noarch.rpm 
  3. yum repolist enabled | grep "mysql.*-community.*"
  4. yum install mysql-community-server
  5. service mysqld start/stop/status
  6. mysql --version
查看临时密码:
  1. grep 'temporary password' /var/log/mysqld.log
  2. service mysqld stop
  3. mysql_secure_installation
Sample Output
  1. Securing the MySQL server deployment.
  2. Enter password for user root: Enter New Root Password
  3. VALIDATE PASSWORD PLUGIN can be used to test passwords
  4. and improve security. It checks the strength of password
  5. and allows the users to set only those passwords which are
  6. secure enough. Would you like to setup VALIDATE PASSWORD plugin?
  7. Press y|Y for Yes, any other key for No: y
  8. There are three levels of password validation policy:
  9. LOW    Length >= 8
  10. MEDIUM Length >= 8, numeric, mixed case, and special characters
  11. STRONG Length >= 8, numeric, mixed case, special characters and dictionary                  file
  12. Please enter 0 = LOW, 1 = MEDIUM and 2 = STRONG: 2
  13. Using existing password for root.
  14. Estimated strength of the password: 50 
  15. Change the password for root ? ((Press y|Y for Yes, any other key for No) : y
  16. New password: Set New MySQL Password
  17. Re-enter new password: Re-enter New MySQL Password
  18. Estimated strength of the password: 100 
  19. Do you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : y
  20. By default, a MySQL installation has an anonymous user,
  21. allowing anyone to log into MySQL without having to have
  22. a user account created for them. This is intended only for
  23. testing, and to make the installation go a bit smoother.
  24. You should remove them before moving into a production
  25. environment.
  26. Remove anonymous users? (Press y|Y for Yes, any other key for No) : y
  27. Success.
  28. Normally, root should only be allowed to connect from
  29. 'localhost'. This ensures that someone cannot guess at
  30. the root password from the network.
  31. Disallow root login remotely? (Press y|Y for Yes, any other key for No) : y
  32. Success.
  33. By default, MySQL comes with a database named 'test' that
  34. anyone can access. This is also intended only for testing,
  35. and should be removed before moving into a production
  36. environment.
  37. Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y
  38. - Dropping test database...
  39. Success.
  40. - Removing privileges on test database...
  41. Success.
  42. Reloading the privilege tables will ensure that all changes
  43. made so far will take effect immediately.
  44. Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y
  45. Success.
  46. All done! 
测试:
  1. mysql -u root -p

配置Mysql相关属性:
说明:Mysql5.7 对密码的要求比较高,若是修改密码不成功,可以进行如下设置;
  1. # mysql -uroot -p
  2. mysql> SHOW VARIABLES LIKE 'validate_password%';
  3. +--------------------------------------+--------+
  4. | Variable_name | Value |
  5. +--------------------------------------+--------+
  6. | validate_password_dictionary_file | |
  7. | validate_password_length | 8 |
  8. | validate_password_mixed_case_count | 1 |
  9. | validate_password_number_count | 1 |
  10. | validate_password_policy | MEDIUM |
  11. | validate_password_special_char_count | 1 |
  12. +--------------------------------------+--------+
  13. mysql> SET GLOBAL validate_password_policy='LOW';
  14. mysql> SET GLOBAL validate_password_length=4;

关于安全等级更详细的介绍如下
  • LOW 政策只测试密码长度。 密码必须至少有8个字符长。 MEDIUM 政策的条件 密
  • 码必须包含至少1数字字符,1 大写和小写字符,和1特别 (nonalphanumeric)字符。
  • STRONG 政策的情况 密码子字符串长度为4的或更长时间不能匹配 单词在字典文件中,如果一个人被指定。

  1. [root@master ~]# mysql -uroot -p
  2. Enter password:
  3. Welcome to the MySQL monitor.  Commands end with ; or \g.
  4. Your MySQL connection id is 3
  5. Server version: 5.5.38 MySQL Community Server (GPL) by Remi
  6. Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
  7. Oracle is a registered trademark of Oracle Corporation and/or its
  8. affiliates. Other names may be trademarks of their respective
  9. owners.
  10. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
  11. mysql> create database oozie;
  12. Query OK, 1 row affected (0.00 sec)
  13. mysql> grant all privileges on oozie.* to 'oozie'@'localhost' identified by 'oozie';
  14. Query OK, 0 rows affected (0.00 sec)
  15. mysql> grant all privileges on oozie.* to 'oozie'@'%' identified by 'oozie';
  16. Query OK, 0 rows affected (0.00 sec)
  17. mysql> exit
  18. Bye
修改Oozie配置文件:
  1. vi /etc/oozie/conf/oozie-site.xml
修改如下属性:(共4个)
  1. <property>
  2. <name>oozie.service.JPAService.jdbc.driver</name>
  3. <value>com.mysql.jdbc.Driver</value>
  4. </property>
  5. <property>
  6. <name>oozie.service.JPAService.jdbc.url</name>
  7. <value>jdbc:mysql://localhost:3306/oozie</value>
  8. </property>
  9. <property>
  10. <name>oozie.service.JPAService.jdbc.username</name>
  11. <value>oozie</value>
  12. </property>
  13. <property>
  14. <name>oozie.service.JPAService.jdbc.password</name>
  15. <value>oozie</value>
  16. </property>
说明:oozie.service.JPAService.jdbc.url 中的 localhost 实际上是“hostname”执行显示的值;

下载并安装MySQL JDBC 连接驱动JAR包到Oozie lib
  1. [root@master oozie]# cd /tmp/
  2. [root@master tmp]# wget http://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-5.1.31.tar.gz
  3. [root@master tmp]# tar -zxf mysql-connector-java-5.1.31.tar.gz
  4. [root@master tmp]# cd mysql-connector-java-5.1.31
  5. [root@master mysql-connector-java-5.1.31]# cp mysql-connector-java-5.1.31-bin.jar /var/lib/oozie/
Create oozie database schema 
  1. [root@master ~]# sudo -u oozie /usr/lib/oozie/bin/ooziedb.sh create -run
  2. Sample Output
  3. setting OOZIE_CONFIG=/etc/oozie/conf
  4. setting OOZIE_DATA=/var/lib/oozie
  5. setting OOZIE_LOG=/var/log/oozie
  6. setting OOZIE_CATALINA_HOME=/usr/lib/bigtop-tomcat
  7. setting CATALINA_TMPDIR=/var/lib/oozie
  8. setting CATALINA_PID=/var/run/oozie/oozie.pid
  9. setting CATALINA_BASE=/usr/lib/oozie/oozie-server-0.20
  10. setting CATALINA_OPTS=-Xmx1024m
  11. setting OOZIE_HTTPS_PORT=11443
  12. ...
  13. DONE
  14. Oozie DB has been created for Oozie version '3.3.2-cdh4.7.0'
  15. The SQL commands have been written to: /tmp/ooziedb-8250405588513665350.sql
安装 ExtJS lib以便在网页中浏览
  1. [root@master ~]# cd /tmp/
  2. [root@master tmp]# wget http://archive.cloudera.com/gplextras/misc/ext-2.2.zip
  3. [root@master tmp]# unzip ext-2.2.zip
  4. [root@master tmp]# mv ext-2.2 /var/lib/oozie/
开启Oozie Server
  1. [root@master tmp]# service oozie status
  2. not running.
  3. [root@master tmp]# service oozie start
  4. [root@master tmp]# service oozie status
  5. running
  6. [root@master tmp]# oozie admin -oozie http://localhost:11000/oozie -status
  7. System mode: NORMAL
通过web访问:http://IP:11000










posted on 2016-10-19 15:47  ssslinppp  阅读(3022)  评论(0编辑  收藏  举报