首页 > 技术文章 > cdh5.7 做完HA后hive 查询出现异常: expected: hdfs://nameservice

zhanggl 2016-08-09 16:25 原文

异常信息如下:

select * from b_pt_pr_customer_address_info limit 19;
FAILED: SemanticException Unable to determine 

if hdfs://nodexx:8020/user/hive/warehouse/ss_aa_bb_info is encrypted: java.lang.IllegalArgumentException: Wrong FS: hdfs://nodexx:8020/user/hive/warehouse/
ss_aa_bb_pt_pr_customer_address_info, expected: hdfs://nameservice

异常原因: 做完HA后 hive 查询hdfs上文件只认 hdfs://nameservice1

解决办法:

1、需要修改hive 数据库里面

DBS  : Hive数据仓库的总路径  

SDS  : Hive每张表对应的路径

2张表的数据。

将原来节点信息修改为HA后的名称 

例如:DBS 表中:的DB_LOCATION_URI:hdfs://nodexx:8020/user/hive/warehouse  修改为hdfs://nameservice1/user/hive/warehouse 即可。

SDS表 需要将LOCATION 修改为hdfs://nameservice1开头

修改前:

修改后:

 

推荐阅读