9. Upgrade Oozie

  1. Before you upgrade, stop any job in a RUNNING or SUSPENDED state before you upgrade:

    oozie job -oozie http://localhost:11000/oozie -kill 14-20090525161321-oozie-joe
  2. Execute the following command on the Oozie server and client machines:

    • For RHEL/CentOS:

      rm -rf /usr/lib/oozie/
      rm -rf /var/lib/oozie/
      yum install oozie  
    • For SLES:

      Run the following commands:

      zypper rm oozie
      zypper up oozie

  3. Remove your old Oozie configuration. First change permisisons on oozie-tomcat-conf and then remove the /usr/lib/oozie/conf directory.

    chmod -R 777 /etc/alternatives/oozie-tomcat-conf/conf
    rm /usr/lib/oozie/conf
  4. Create a symlink for /usr/lib/oozie/conf to /etc/oozie/conf.

    ln -s /etc/oozie/conf /usr/lib/oozie/conf
  5. You must replace your configuration after upgrading. Copy /etc/oozie/conf from the template to the conf directory on each oozie server and client.

  6. Change the JDBC config to match your Oozie database. The entries to edit are:

    oozie.service.JPAService.jdbc.driver
    oozie.service.JPAService.jdbc.url

    For example, for MySQL, use:

    oozie.service.JPAService.jdbc.driver = com.mysql.jdbc.Driver
    oozie.service.JPAService.jdbc.url = jdbc:mysql://$my_server:my_port/oozie?createDatabaseIfNotExist=true

  7. Copy the JDBC jar to libext-customer.

    1. Create the /usr/lib/oozie/libext-customer directory.

      cd /usr/lib/oozie
      mkdir libext-customer
    2. Grant read/write/execute access to all users for the libext-customer directory.

      chmod -R 777 /usr/lib/oozie/libext-customer

  8. Copy the JDBC jar of your Oozie database to the libext-customer directory. For example, if you are using MySQL, copy your mysql-connector-java.jar to /usr/lib/oozie/libext-customer and /usr/lib/oozie/libtools.

    [Note]Note

    HDP 2.1 does not provide the MySQL jar. You can download one from MySQL, when you download mysql-connector-java here.

  9. Copy these files to the libext-customer directory

    cp /usr/lib/hadoop/lib/hadoop-lzo*.jar /usr/lib/oozie/libext-customer
    cp /usr/share/HDP-oozie/ext-2.2.zip /usr/lib/oozie/libext-customer/ 
  10. Extract share-lib.

    cd /usr/lib/oozie
    tar xzvf /usr/lib/oozie//oozie-sharelib.tar.gz
    su -l hdfs -c "hdfs dfs -rmr /user/oozie" <!--remove your old oozie user dir-->
    su -l hdfs -c "hdfs dfs -mkdir -p /user/oozie" <!--create new oozie user dir-->
    su -l hdfs -c "hdfs dfs -copyFromLocal /usr/lib/oozie/share /user/oozie/."

    You may see complaints that some files exist. This is an expected behavior.

    su -l hdfs -c "hdfs dfs -chown oozie:hadoop /user/oozie"
    su -l hdfs -c "hdfs dfs -chmod -R 755 /user/oozie"
  11. Run upgrade as the Oozie user. Do not run as the root user to execute this.

    su $OOZIE_USER
    /usr/lib/oozie/bin/ooziedb.sh upgrade -run
  12. Prepare the Oozie WAR file. Run as root:

    sudo su -l oozie -c "/usr/lib/oozie/bin/oozie-setup.sh prepare-war -d /usr/lib/oozie/libext-customer"

    Look for console output to indicate success. For example, if you are using MySQL you should see something similar to:

    INFO: Adding extension: libext-customer/mysql-connector-java.jar
    New Oozie WAR file with added 'JARs' at /var/lib/oozie/oozie-server/webapps/oozie.war 
  13. Replace the content of /user/oozie/share in HDFS. On the Oozie server host:

    1. Extract the Oozie sharelib into a tmp folder.

      mkdir -p /tmp/oozie_tmp
      cp /usr/lib/oozie/oozie-sharelib.tar.gz /tmp/oozie_tmp
      cd /tmp/oozie_tmp
      tar xzvf oozie-sharelib.tar.gz
    2. Back up the/user/oozie/share folder in HDFS and then delete it. If you have any custom files in this folder back them up separately and then add them back after the share folder is updated.

      su -l hdfs -c "hdfs dfs -copyToLocal /user/oozie/share /tmp/oozie_tmp/oozie_share_backup"
      su -l hdfs -c "hdfs dfs -rm -r /user/oozie/share"
    3. Add the latest share libs that you extracted in step 1. After you have added the files, modify ownership and ACL.

      su -l hdfs -c "hdfs dfs -copyFromLocal /tmp/oozie_tmp/share /user/oozie/."
      su -l hdfs -c "hdfs dfs -chown -R oozie:hadoop /user/oozie"
      su -l hdfs -c "hdfs dfs -chmod -R 755 /user/oozie"
  14. Set the oozie.service.WorkflowAppService.system.libpath in oozie-site.xml to the right path of sharelib in hdfs.

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

  15. Start Oozie. Run as root.

    sudo su -l oozie -c "cd /grid/0/var/log/oozie; /usr/lib/oozie/bin/oozie-start.sh"
  16. Check processes.

    ps -ef | grep -i oozie

loading table of contents...