Release Notes
Announcements
Security Announcements
mysqldump -hX.X.X.X -uroot -pXXXX --single-transaction --set-gtid-purged=OFF hivemetastore > hivemetastore-src.sql# If MySQL does not have GTID enabled, remove --set-gtid-purged=OFF from the command line.# X.X.X.X represents the database server address.# XXXX represents the database password.# If the database user is not root, use the correct username.# hivemetastore is the name of the Hive Metastore.
hive.metastore.warehouse.dir configuration item in hive-site.xml. If the storage path of Hive tables in HDFS for the target cluster needs to match that of the source cluster, you can modify the configuration file accordingly. For example, in the source cluster’s hive-site.xml, hive.metastore.warehouse.dir is set as follows:<property><name>hive.metastore.warehouse.dir</name><value>/apps/hive/warehouse</value></property>
hive-site.xml, hive.metastore.warehouse.dir is set as follows:<property><name>hive.metastore.warehouse.dir</name><value>/usr/hive/warehouse</value></property>
hive-site.xml in the target to set hive.metastore.warehouse.dir to:<property><name>hive.metastore.warehouse.dir</name><value>/apps/hive/warehouse</value></property>
SELECT DB_LOCATION_URI from DBS;SELECT LOCATION from SDS;
mysql> SELECT LOCATION from SDS;+--------------------------------------------------+| LOCATION |+--------------------------------------------------+| hdfs://HDFS2648/usr/hive/warehouse/hitest.db/t1 || hdfs://HDFS2648/usr/hive/warehouse/wyp |+--------------------------------------------------+mysql> SELECT DB_LOCATION_URI from DBS;+-----------------------------------------------+| DB_LOCATION_URI |+-----------------------------------------------+| hdfs://HDFS2648/usr/hive/warehouse || hdfs://HDFS2648/usr/hive/warehouse/hitest.db |+-----------------------------------------------+
hdfs://HDFS2648 is the default HDFS file system name, specified by the fs.defaultFS parameter in core-site.xml.<property><name>fs.defaultFS</name><value>hdfs://HDFS2648</value></property>
/usr/hive/warehouse is the default storage path for Hive tables in HDFS, which is also the value specified by hive.metastore.warehouse.dir in hive-site.xml. Therefore, we need to modify the SDS.LOCATION and DBS.DB_LOCATION_URI fields in the source Hive metadata SQL file. Ensure that these two fields in the imported Hive Metastore use the correct paths. You can use the following sed command to batch modify the SQL file.Replace the IP address: sed -i 's/oldcluster-ip:4007/newcluster-ip:4007/g' hivemetastore-src.sqlReplace the defaultFS: sed -i 's/old-defaultFS/new-defaultFS/g' hivemetastore-src.sql
mysqldump -hX.X.X.X -uroot -pXXXX --single-transaction --set-gtid-purged=OFF hivemetastore > hivemetastore-target.sql# If MySQL does not have GTID enabled, remove --set-gtid-purged=OFF from the command line.# X.X.X.X represents the database server address.# XXXX represents the database password.# If the database user is not root, use the correct username.# hivemetastore is the name of the Hive Metastore.
mysql> drop database hivemetastore;mysql> create database hivemetastore;
mysql -hX.X.X.X -uroot -pXXXX hivemetastore < hivemetastore-src.sql# X.X.X.X represents the database server address.# XXXX represents the database password.# If the database user is not root, use the correct username.# hivemetastore is the name of the Hive Metastore.
hive --service version
/usr/local/service/hive/scripts/metastore/upgrade/mysql/ directory.Hive does not support cross-version upgrades; for example, upgrading Hive from 1.2 to 2.3.0 requires executing each intermediate upgrade sequentially.upgrade-1.2.0-to-2.0.0.mysql.sql -> upgrade-2.0.0-to-2.1.0.mysql.sql -> upgrade-2.1.0-to-2.2.0.mysql.sql -> upgrade-2.2.0-to-2.3.0.mysql.sql
mysql> source upgrade-2.3.0-to-3.0.0.mysql.sql;mysql> source upgrade-3.0.0-to-3.1.0.mysql.sql;
phoenix.zookeeper.quorum configuration for the Phoenix table.mysql> SELECT PARAM_VALUE from TABLE_PARAMS where PARAM_KEY = 'phoenix.zookeeper.quorum';+--------------------------------------------------+| PARAM_VALUE |+--------------------------------------------------+| 172.17.64.57,172.17.64.78,172.17.64.54 |+--------------------------------------------------+
hbase.zookeeper.quorum field in the hive-site.xml configuration file.<property><name>hbase.zookeeper.quorum</name><value>172.17.64.98:2181,172.17.64.112:2181,172.17.64.223:2181</value></property>
mysql> UPDATE TABLE_PARAMS set PARAM_VALUE = '172.17.64.98,172.17.64.112,172.17.64.223' where PARAM_KEY = 'phoenix.zookeeper.quorum';
alter table metastore_db_properties rename to METASTORE_DB_PROPERTIES;
フィードバック