2. Upgrade the Stack

  1. Upgrade the HDP repository on all hosts and replace the old repository file with the new file:

    • For RHEL/CentOS/Oracle Linux 5

      wget  http://public-repo-1.hortonworks.com/HDP/centos5/2.x/updates/2.1.5.0/hdp.repo -O /etc/yum.repos.d/HDP.repo
    • For RHEL/CentOS/Oracle Linux 6

      wget http://public-repo-1.hortonworks.com/HDP/centos6/2.x/updates/2.1.5.0/hdp.repo -O /etc/yum.repos.d/HDP.repo
    • For SLES 11 sp1

      wget http://public-repo-1.hortonworks.com/HDP/sles11sp1/2.x/updates/2.1.5.0/hdp.repo -O /etc/zypp/repos.d/hdp.repo
    [Important]Important

    Make sure to download the HDP.repo file under /etc/yum.repos.d on ALL hosts.

  2. Update the Stack version in the Ambari Server database. Use this command to update the Stack version to HDP-2.1:

    ambari-server upgradestack HDP-2.1
  3. Back up the files in following directories on the Oozie server host and make sure that all files, including *site.xml files are copied.

    mkdir oozie-conf-bak 
    cp -R /etc/oozie/conf/* oozie-conf-bak
  4. Remove the old oozie directories on all Oozie server and client hosts

    • rm -rf /etc/oozie/conf

    • rm -rf /usr/lib/oozie/

    • rm -rf /var/lib/oozie/

  5. Upgrade the Stack on all Ambari Agent hosts.

    [Note]Note

    For each host, identify the HDP components installed on each host. Use Ambari Web, as described here, to view components on each host in your cluster. Based on the HDP components installed, tailor the following upgrade commands for each host to upgrade only components residing on that host. For example, if you know that a host has no HBase service or client packages installed, then you can adapt the command to not include HBase, as follows:

    yum upgrade "collectd*" "gccxml*" "pig*" "hadoop*" "sqoop*" "zookeeper*" "hive*"
    [Important]Important

    If you are writing to mulitple systems using a script, do not use " " with the run command. You can use " " with pdsh -y.

    • For RHEL/CentOS/Oracle Linux

      1. Remove WebHCat, HCatalog, and Oozie components.

        yum erase "webhcat*" "hcatalog*" "oozie*"
      2. Upgrade the following components:

        yum upgrade "collectd*" "gccxml*" "pig*" "hadoop*" "sqoop*" "zookeeper*" "hbase*" "hive*" hdp_mon_nagios_addons
        yum install webhcat-tar-hive webhcat-tar-pig
        yum install hive*
        yum install oozie oozie-client
        rpm -e --nodeps bigtop-jsvc
        yum install bigtop-jsvc
      3. Verify that the components were upgraded:

        yum list installed | grep HDP-$old-stack-version-number

        None of the components from that list should appear in the returned list.

    • For SLES

      1. Remove WebHCat, HCatalog, and Oozie components.

        zypper remove webhcat\* hcatalog\* oozie\*
      2. Upgrade the following components:

        zypper up "collectd*" "gccxml*" "pig*" "hadoop*" "sqoop*" "zookeeper*" "hbase*" "hive*" hdp_mon_nagios_addons
        zypper install webhcat-tar-hive webhcat-tar-pig
        zypper up -r HDP-2.1.2.0
        zypper install hive\*
        zypper install oozie oozie-client
      3. Verify that the components were upgraded:

        rpm -qa | grep hadoop, && rpm -qa | grep hive && rpm -qa | grep hcatalog
      4. If components were not upgraded, upgrade them as follows:

        yast --update hadoop hcatalog hive
  6. Upgrade the Hive metastore database schema.

    $HIVE_HOME/bin/schematool -upgradeSchema -dbType <$databaseType>  -userName <$connectionUserName> -passWord <$connectionPassWord> 

    where $username and $password are credentials with permissions sufficient to override the config file, and $databaseType equals any of the following databases type values:

    • derby

    • mysql

    • oracle

    • postgres

    For more information about using the Hive Schema tool, see the Hive Schema Tool documentation.