Fix an issue where the hive path is incorrect after namenode configuration of HA
After CDH5.7 is configured with Namenode ha, hive has no normal query data, but other components HDFs, HBase, and Spark are normal.
The following exception occurred in the hive query:
Failed:semanticexception unable to determine if Hdfs://bdc240.hexun.com:8020/user/hive/warehouse/test1 is encrypted: Java.lang.IllegalArgumentException:Wrong Fs:hdfs://bdc240.hexun.com:8020/user/hive/warehouse/test1, expected: Hdfs://nameservice1
All kinds of reloading service is not solved.
A friend reminder should be the hive metadata problem, there are two tables in the Hive database:
Dbs:hive the total path of the Data Warehouse
Sds:hive path for each table
The path of the original HDFs is saved in the database and modified to an ha corresponding alias.
In general, the metabase uses MySQL to replace field content with SQL, which is convenient:
Related SQL Specification:
Update table name set field name =replace (field name, ' original value ', ' value to modify ')
Modification Example:
Update DBS Set Db_location_uri=replace (Db_location_uri, ' bdc240.hexun.com:8020 ', ' Nameservice1 ');
Update SDS set Location=replace (location, ' bdc240.hexun.com:8020 ', ' Nameservice1 ');