After you upgrade Hive with the MapR Installer, perform the following
steps.
Procedure
-
Kill the old Hive process.
-
Run the following command to check for Hive processes that are
running:
-
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.
-
Update the Hive Metastore.
-
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:
-
- upgrade-0.13.0-to-0.14.0.<metastore_database>.sql
- upgrade-0.14.0-to-1.1.0.<metastore_database>.sql
- For upgrades from Hive 0.13 to 1.2.1:
-
- upgrade-0.13.0-to-0.14.0.<metastore_database>.sql
- upgrade-0.14.0-to-1.1.0.<metastore_database>.sql
- 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.
-
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.
-
Migrate Hive Configuration (optional).
Migrate any custom configuration settings into the new default files in the
conf directory (/opt/mapr/hive/hive-<version>/conf/)
-
Restart Hive Services.
-
Make a list of nodes on which Hive Metastore and HiveServer2 Services
are configured.
-
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>