栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 前沿技术 > 大数据 > 大数据系统

使用 JDBC 方式访问 Hive处理;

使用 JDBC 方式访问 Hive处理;

 hive-site.xml 文件中添加配置

 
     hive.metastore.schema.verification
     false

 
 
     hive.metastore.event.db.notification.api.auth
     false
 
 
 
     hive.metastore.warehouse.dir
     /user/hive/warehouse
 
  
 
     hive.metastore.uris
     thrift://192.168.1.35:9083
 

 
	 hive.server2.thrift.bind.host
	 192.168.1.35
 
 
 
	 hive.server2.thrift.port
	 10000
 
 
	 hive.server2.active.passive.ha.enable
	 true
 

 JDBC 方式访问 Hive时,必须开启hive的元数据存储;

启动 metastore 

bin/hive --service metastore

2)启动 hiveserver2

bin/hive --service hiveserver2

启动 beeline 客户端(需要多等待一会)

bin/beeline -u jdbc:hive2://192.168.1.35:10000 -n atguigu

异常处理; zwl is not allowed to impersonate zwl

Caused by: java.lang.RuntimeException: org.apache.hadoop.ipc.RemoteException(org.apache.hadoop.security.authorize.AuthorizationException): User: root is not allowed to impersonate root 
    at org.apache.hadoop.hive.ql.session.SessionState.start(SessionState.java:651) ~[hive-exec-3.1.2.jar:3.1.2]
    at org.apache.hadoop.hive.ql.session.SessionState.start(SessionState.java:586) ~[hive-exec-3.1.2.jar:3.1.2]
    at org.apache.hive.service.cli.session.HiveSessionImpl.open(HiveSessionImpl.java:179) ~[hive-service-3.1.2.jar:3.1.2]

修改hadoop的core-site.xml配置文件
表示可通过超级代理“xxx”操作hadoop的用户、用户组和主机

    
        
        hadoop.proxyuser.root.groups
        *
    
  
    
        
        hadoop.proxyuser.root.hosts
        *
    
	
	
		hadoop.proxyuser.zwl.groups
		*
    
    
        
        hadoop.proxyuser.zwl.hosts
        *
    
	


    
在conf/hive-site.xml中加入以下配置:
默认情况下HiveServer2 执行查询时使用的用户是提交查询的用户.但是如果将这个选项设置为false,查询将会使用运行hiveserver2的用户。


    hive.server2.enable.doAs
    false
 
转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/326397.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号