首页 > 其他 > 详细

Hive的访问接口

时间:2015-02-09 20:17:15      阅读:355      评论:0      收藏:0      [点我收藏+]

Hive提供了三种客户端访问接口:

1)Hive CLI(Hive Command Line,Hive命令行),客户端可以直接在命令行模式下进行操作。

2)hwi(Hive Web Interface,Hive Web接口),Hive提供了更直观的Web界面

3)hiveserver,Hive提供了Thrift服务,Thrift客户端目前支持C++/Java/PHP/Python/Ruby。

下面我们来分别尝试下这三种接口访问方式:

一、Hive CLI

直接键入hive命令即可进入CLI模式:

[cloud@cloud01 lib]$ hive

Hive history file=/tmp/cloud/hive_job_log_cloud_201110311056_1009535967.txt

hive> show tables;

OK

testhivedrivertable

Time taken:3.038 seconds

hive>select*from testhivedrivertable;

OK

Time taken:0.905 seconds

hive> quit;[cloud@cloud01 lib]$

更多的命令选项,参见官方wiki,Hive Cli

二、Hive hwi

Hive hwi提供了一个更直观的web界面,使用起来更方便。

1)启动hive hwi

[cloud@cloud01 ~]$ hive --service hwi

11/10/3110:14:11 INFO hwi.HWIServer: HWI is starting up

11/10/3110:14:11 INFO mortbay.log:Logging to org.slf4j.impl.Log4jLoggerAdapter(org.mortbay.log) via org.mortbay.log.Slf4jLog11/10/3110:14:11 INFO mortbay.log: jetty-6.1.1411/10/3110:14:11 INFO mortbay.log:Extract jar:file:/data/cloud/hive-0.7.1/lib/hive-hwi-0.7.1.war!/ to /tmp/Jetty_0_0_0_0_9999_hive.hwi.0.7.1.war__hwi__.hf8ccz/webapp

11/10/3110:14:12 INFO mortbay.log:StartedSocketConnector@0.0.0.0:9999

2)通过hwi方式访问Hive

我的Hive部署在10.46.169.101机器上,hive默认hwi端口为9999。我们在浏览器中键入http://10.46.169.101:9999/hwi/ 就可以访问了。

Hive的访问接口

原文:http://blog.csdn.net/preterhuman_peak/article/details/43674201

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!