Hive学习 (三)Hive的连接三种连接方式

目录


一、CLI连接
二、HiveServer2/beeline
    1、修改 hadoop 集群的 hdfs-site.xml 配置文件
    2、修改 hadoop 集群的 core-site.xml 配置文件

三、Web UI

正文:

一、CLI连接

进入到 bin 目录下,直接输入命令:

[potter@potter2 ~]$ hive
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/home/potter/apps/apache-hive-2.3.3-bin/lib/log4j-slf4j-impl-2.6.2.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/potter/apps/hadoop-2.7.5/share/hadoop/common/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]

Logging initialized using configuration in jar:file:/home/potter/apps/apache-hive-2.3.3-bin/lib/hive-common-2.3.3.jar!/hive-log4j2.properties Async: true
Hive-on-MR is deprecated in Hive 2 and may not be available in the future versions. Consider using a different execution engine (i.e. spark, tez) or using Hive 1.X releases.
hive>

查看:

hive> show databases;
OK
default
myhive
Time taken: 12.432 seconds, Fetched: 2 row(s)
hive> 

启动成功的话如上图所示,接下来便可以做 hive 相关操作

补充:

1、上面的 hive 命令相当于在启动的时候执行:hive --service cli

2、使用 hive --help,可以查看 hive 命令可以启动那些服务

3、通过 hive --service serviceName --help 可以查看某个具体命令的使用方式

二、HiveServer2/beeline

在现在使用的最新的 hive-2.3.3 版本中:都需要对 hadoop 集群做如下改变,否则无法使用

第一:修改 hadoop 集群的 hdfs-site.xml 配置文件:加入一条配置信息,表示启用 webhdfs

<property>
 <name>dfs.webhdfs.enabled</name>
 <value>true</value>
</property>

第二:修改 hadoop 集群的 core-site.xml 配置文件࿱

  • 1
    点赞
  • 22
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值