ARTICLE DETAIL

建站实战干货

来自一线的建站与推广经验沉淀,每一条都经过真实交付验证。

【Hive】——CLI客户端(bin/beeline,bin/hive)

2026/9/14 0:24:59 拓冰建站 浏览量
【Hive】——CLI客户端(bin/beeline,bin/hive)

在这里插入图片描述

1 HiveServer、HiveServer2

在这里插入图片描述

2 bin/hive 、bin/beeline 区别

在这里插入图片描述
在这里插入图片描述

3 bin/hive 客户端

在这里插入图片描述
hive-site.xml 配置远程 MateStore 地址

XML
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration><!-- 远程模式部署metastore 服务地址 --><property><name>hive.metastore.uris</name><value>thrift://hadoop102:9083</value><description>Thrift URI for the remote metastore. Used by metastore client to connect to remotemetastore.</description></property>
</configuration>

4 bin/beeline 客户端

官方文档
https://cwiki.apache.org/confluence/display/Hive/HiveServer2+Clients#HiveServer2Clients-Beeline%E2%80%93NewCommandLineShell
在这里插入图片描述

4.1 启动Hiveserver2服务

Shell
cd /opt/module/hive/bin
hive --service hiveserver2 &

4.2 连接beeline客户端

使用beeline客户端进行连接访问,需要注意hiveserver2服务启动之后需要稍等一会才可以对外提供服务。
Beeline 是JDBC客户端,同构JDBC歇息和Hiveserver2服务进行通信。协议地址是:jdbc:hive2://hadoop102:1000
在这里插入图片描述