Post-Upgrade Steps for Hive
Complete the following steps after you upgrade Hive with or without the MapR Installer.
About this task
Procedure
-
Migrate Hive Configuration.
Migrate any custom configuration settings into the new default files in the
/opt/mapr/hive/hive-<version>/conf/
directory. -
Update the Hive Metastore.
For upgrades from old version of Hive to new version, run the
schematool
command with the-upgradeSchema
option.
For example, for upgrades from Hive 1.2 to 2.1 on MySql, run the following command:/opt/mapr/hive/hive-<version>/bin/schematool -dbType <metastore_database> -upgradeSchema
/opt/mapr/hive/hive-2.1/bin/schematool -dbType mysql -upgradeSchema
NOTE: Review and, if necessary, perform the steps described in Troubleshooting before running this command. -
Run
configure.sh
. If you installed themapr-hivewebhcat
package, runconfigure.sh
with the-R
option on the node where you installed themapr-hivewebhcat
package.
This step enables Warden to recognize the newly installed service./opt/mapr/server/configure.sh -R
-
Restart Hive Services.
-
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.
- Run the
Troubleshooting
About this task
Inconsistencies in the underlying database after creating tables with
datanucleus.schema.autoCreateAll
property.
The datanucleus.schema.autoCreateAll
property creates tables
gradually. After creating tables using this property, if you upgrade to Hive 2.1
using schematool
, the schematool
command will
not be able to verify all the necessary tables because all the necessary tables
were not created by the datanucleus.schema.autoCreateAll
property.
Perform the following steps as a precondition.
Procedure
- Determine the version from which you are upgrading.
-
Start MySQL.
mysql -u<user> -p<password>
-
Run the following commands in MYSQL command line. For upgrade from:
- Hive 0.13:
USE metastore; SOURCE /opt/mapr/hive/hive-2.1/scripts/metastore/upgrade/mysql/hive-schema-0.13.0.mysql.sql;
- Hive 1.0:
USE metastore; SOURCE /opt/mapr/hive/hive-2.1/scripts/metastore/upgrade/mysql/hive-schema-0.14.0.mysql.sql;
- Hive 1.2:
USE metastore; SOURCE /opt/mapr/hive/hive-2.1/scripts/metastore/upgrade/mysql/hive-schema-1.2.0.mysql.sql; SOURCE /opt/mapr/hive/hive-2.1/scripts/metastore/upgrade/mysql/hive-txn-schema-0.13.0.mysql.sql;
RunningSOURCE
for the version before the upgrade makes the underlying database consistent for runningschematool
command with the-upgradeSchema
option. - Hive 0.13: