ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

Hive远程模式

2022-02-27 11:01:01  阅读:185  来源: 互联网

标签:10000 sam02 hive hiveserver2 metastore 模式 Hive root 远程


前提:hive的本地模式与内嵌模式都已经完成

1. 集群主机Hadoop的core-site.xml文件添加以下内容

<property>
    <name>hadoop.proxyuser.root.hosts</name>
    <value>*</value>
</property>
<property>
    <name>hadoop.proxyuser.root.groups</name>
    <value>*</value>
</property>

image
注意:参与hive远程连接功能的主机都需要配置以上内容

2. 启动hive的服务(分别有两种服务)

2.1 启动hiveserver2

方式1

[root@sam02 hadoop]# hive --service hiveserver2 &

image


方式2

hive --service hiveserver2 >/dev/null 2>&1 &

image

2.2 启动metastore服务

方式1

[root@sam02 hive]# hive --service metastore &

image

方式2

[root@sam02 hive]# hive --service metastore 2>&1 >/dev/null &

image

3. 客户端连接hiveserver2服务

方式1

step1	[root@sam01 ~]# beeline
step2	beeline> !connect jdbc:hive2://sam02:10000
step3	Enter username for jdbc:hive2://sam02:10000: root
step4	Enter password for jdbc:hive2://sam02:10000: ***

image

方式2

beeline -u jdbc:hive2://ip:10000 -n 用户名

解析:
hive2,是hive的协议名称
ip: hiveserver2服务所在的主机IP。
10000,是hiveserver2的端口号d


4. 客户端连接metastore服务

4.1 客户端sam01配置hive-site.xml

4.1.1 删除configuration的内容

4.1.2 在configuratioin添加以下内容

<property>
	<name>hive.metastore.uris</name> 
	<value>thrift://ip:9083</value>
</property>

解析:
thrift:是协议名称
ip为metastore服务所在的主机ip地址
9083是默认端口号


image


4.2 使用hive进行连接

[root@sam01 ~]# hive

image

标签:10000,sam02,hive,hiveserver2,metastore,模式,Hive,root,远程
来源: https://www.cnblogs.com/sam0/p/15941719.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有