【Oozie】安裝配置Oozie


安裝和配置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











免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM