HWI-hive web页面的搭建

 

hwi(hive web interface)是hive命令行接口的一个补充,主要功能包括:

1.shema browsing :获取table的信息,包括serde、columen name、column type

2.detached query execution:在hive命令行界面,用户如果需要执行多个查询,则需要同时打开多个命令行界面。hwi允许用户同时开始多个查询,并且查看执行状态。

3.no local installation:如何人,只要有web browser就可以连接hive,而无需运行安装运行任何客户端。

 

从hive 0.8.1开始,自带hwi,简单配置下即可使用

1.    配置hive

vi ${HIVE_HOME}/conf/hive-site.xml

hive-site.xml在安装hive的时候已经创建好,只需要在后面加上下面的配置即可

<property>

 <name>hive.hwi.listen.host</name>

 <value>0.0.0.0</value>

 <description>This is the host address the Hive Web Interface willlisten on</description>

</property>

 

<property>

 <name>hive.hwi.listen.port</name>

 <value>9999</value>

 <description>This is the port the Hive Web Interface will listenon</description>

</property>

 

<property>

 <name>hive.hwi.war.file</name>

 <value>lib/hive_hwi.war</value> //这个下面讲

 <description>This is the WAR file with the jsp content for HiveWeb Interface</description>

</property>

测试环境下,使用默认值即可,需要hive-site.xml文件,否则报错。

 

2现在要做的就是添加apache ant的编译工具,不安装则会报错

Problem accessing /hwi/. Reason:

    No Java compiler available

 

2.1安装ant

下载安装包wget http://apache.mirrors.tds.net/ant/binaries/apache-ant-1.9.4-bin.tar.gz

解压缩:tar -zxvf apache-ant-1.9.4-bin.tar.gz

切换到解压目录cd apache-ant-1.9.4

cp -arp * /usr/local/ant

vi /etc/profile

export ANT_HOME=/usr/local/ant

export ANT_LIB=/usr/local/ant/lib

PATH添加/usr/local/ant/bin:

使profile生效:source/etc/profile

执行 ant -v 或者 ant--version 来验证 ant 是否已安装好

复制jar

需要把/usr/local/ant/lib下的ant-launcher.jar,ant.jar这两个jar包和jasper-compiler-5.5.23.jar,jasper-runtime-5.5.23.jar这两个jar包(这两个没放,暂时没影响)以及jdk的lib包下面的tools.jar包拷贝到${HIVE_HOME } /lib下,并且需要将相应的权限修改为777,



否则会报错: hive hwi Compile failed; see the compiler error output fordetails.

同时将目录下原有的ant-launcher.jar,ant.jar移除

如果出现

cannot access/home/linux/application/hive2.1.0/lib/hive-hwi-*.war: No such file or directory

报错原因:lib下面没有war包,查找各种资料都提示需要从官网下载hive源代码src文件然后打包web文件夹的war文件。

源代码地址:

http://archive.cloudera.com/cdh5/cdh/5/hive-1.1.0-cdh5.4.0-src.tar.gz

打包war文件

下载自己hive版本的src文件,解压,进入解压后的hwi/web文件夹

jar -cvfhive-hwi-1.1.0.war *

将war包复制到hive安装目录的bin目录下

cphive-hwi-1.1.0.war ${HIVE_HOME}/lib/

修改hive-site.xml里面对应的配置

 

启动HWI

hive --service hwi

然后在浏览器中输入localhost:9999/hwi,即可打开HWI页面。


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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值