第一步:【db升级 ,先看第二步】
cd到 hive的 metastore upgrade目录
cd /usr/hdp/2.5.0.0-1245/hive/scripts/metastore/upgrade/mysql
source 历史版本至升级版本的sql
第二步:
修改ambari hivemeta 链接的db ,重启 。 重启过程中有错 处理方案如下 【下次建议直接执行第二步,怀疑ambari会帮忙执行db升级】
drop index PCS_STATS_IDX on part_col_stats; SET FOREIGN_KEY_CHECKS = 0; drop table txns; drop table txn_components; drop table completed_txn_components; drop table compaction_queue; drop table completed_compactions; drop table aux_table; drop table next_compaction_queue_id; drop table next_txn_id; drop table next_lock_id; drop table hive_locks; drop table write_set; delete from VERSION; SET FOREIGN_KEY_CHECKS = 1; drop index CONSTRAINTS_PARENT_TABLE_ID_INDEX on KEY_CONSTRAINTS; ----下边儿不用执行,只是操作过程中,有删除表且有值得操作 ---next_txn_id next_lock_id next_txn_id next_compaction_queue_id has one value 1 VERSION; has value VER_ID | SCHEMA_VERSION | VERSION_COMMENT | +--------+----------------+-------------------------------+ | 1 | 1.2.1000 | Hive release version 1.2.1000