Post-Upgrade Steps for Hive

After you upgrade Hive with the MapR Installer, perform the following steps.

  1. Kill the old Hive process.
    1. Run the following command to check for Hive processes that are running:
      ps -aux |grep hive
    2. Kill any processes associated with older Hive versions. For example, if you upgraded to Hive 1.0 and a process is still running a hive-webhcat-0.13.0-mapr-1508.jar, you need to kill that process.
      kill <pid>
  2. Update the Hive Metastore.
    1. Refer to the README file in the /opt/mapr/hive/hive-<version>/scripts/metastore/upgrade/<metastore_database> directory for directions on updating your existing metastore_db schema to work with the new Hive version.
      Tip: When you complete the step to run the schema upgrade scripts, run the following scripts:
      For upgrades from Hive 0.13 to 1.0:
      1. upgrade-0.13.0-to-0.14.0.<metastore_database>.sql
      2. upgrade-0.14.0-to-1.1.0.<metastore_database>.sql
      For upgrades from Hive 0.13 to 1.2.1:
      1. upgrade-0.13.0-to-0.14.0.<metastore_database>.sql
      2. upgrade-0.14.0-to-1.1.0.<metastore_database>.sql
      3. upgrade-1.1.0-to-1.2.0.<metastore_database>.sql
      For upgrades from Hive 1.0 to 1.2.1
      • upgrade-1.1.0-to-1.2.0.<metastore_database>.sql
      Note: Run the metastore upgrade scripts from the /opt/mapr/hive/hive-<version>/scripts/metastore/upgrade/<metastore_database> directory. The script sources files from this directory. If you run the script from another location, it will fail.
    2. Verify that the metastore database update completed successfully. For example, use these diagnostic tests:
      • Run the show tables command in Hive and make sure it returns a complete list of all your Hive tables.
      • Perform simple SELECT operations on Hive tables that existed before the upgrade.
      • Perform filtered SELECT operations on Hive tables that existed before the upgrade.
  3. Migrate Hive Configuration (optional).
    Migrate any custom configuration settings into the new default files in the conf directory (/opt/mapr/hive/hive-<version>/conf/)
  4. Restart Hive Services.
    1. Make a list of nodes on which Hive Metastore and HiveServer2 Services are configured.
    2. Issue the maprcli node services command, specifying the nodes on which the Hive services are configured.
      maprcli node services -name hivemeta -action restart -nodes <space delimited list of nodes>
      maprcli node services -name hs2 -action restart -nodes <space delimited list of nodes>