记录配置HDFS HA后,hive抛错Wrong FS
1.问题:
在CDH5.x或者Apache环境下,配置了NameNode的HA后,Hive无正常查询数据了。
Hive查询会出现如下异常:
点击(此处)折叠或打开
- FAILED: SemanticException Unable to determine if hdfs://hadoop-01:8020/user/hive/warehouse/t1
- is encrypted: java.lang.IllegalArgumentException: Wrong FS: hdfs://hadoop-01:8020/user/hive/warehouse/t1, expected: hdfs://nameservice1
2.解决:
Hive元数据的问题,在Hive数据库中有两张表:
DBS : Hive数据仓库的总路径
SDS : Hive每张表对应的路径
a.进入mysqlb.use hive;
c.修改dbs 和 sds表
点击(此处)折叠或打开
- update DBS set DB_LOCATION_URI=REPLACE (DB_LOCATION_URI,'hadoop-01:8020','nameservice1');
- update SDS set LOCATION=REPLACE (LOCATION,'hadoop-01:8020','nameservice1')