Hive的webUI(hwi)配置-详解

官网(最好谷歌打开):https://cwiki.apache.org/confluence/display/Hive/HiveWebInterface

注意官网内容:HWI is only available in Hive releases prior to 2.2.0. It was removed by HIVE-15622.

最终实现:

安装Hive hwi 的方法:

1.下载源代码,根据自己的hive版本下载http://apache.fayea.com/hive/

2.解压后

进入hwi/web/找到view_file.jsp文件,在文件头部指定编码格式:<%@ page contentType="text/html;charset=UTF-8"%>

之后将./hwi/web/ 目录打包成 hive-hwi-**.war 放入放到hive/lib目录下,打包方式是 执行下面的语句

  jar cvfM0 hive-hwi-1.2.1.war -C web/ .

3.更改配置文件,在hive-site.xml 添加参数,参数可以参考在https://cwiki.apache.org/confluence/display/Hive/HiveWebInterface,或在 hive-default.xml.template 中的拷贝相应的参数(监听主机0.0.0.0表示localhost,监听端口,war文件的目录),参数配置如下:

  <property>
      <name>hive.hwi.listen.host</name>
      <value>0.0.0.0</value>
      <description>This is the host address the Hive Web Interface will listen on</description>
    </property>

    <property>
      <name>hive.hwi.listen.port</name>
      <value>9999</value>
      <description>This is the port the Hive Web Interface will listen on</description>
    </property>

    <property>
    #改成自己的文件名 <name>hive.hwi.war.file</name>
    #改成自己的路径 <value>lib/hive-hwi.jar</value> <description>This is the WAR file with the jsp content for Hive Web Interface</description> </property>

4.从 jdk里面的lib下复制tools.jar 到 hive/lib下。

cp ${JAVA_HOME}/lib/tools.jar ${HIVE_HOME}/lib

下载:Ant

Hive Web UI内部是需要Ant来进行编译的,所以需要事先安装ant来支持。下载最新版本的ant。
注意:根据自己JDK版本,选择ant版本
 
1.解压缩:
tar -zxvf apache-ant-1.9.7-bin.tar.gz -C /home/bymain
修改名字
mv apache-ant-1.9.7 ant-1.9.7
 
2.配置环境变量:
vim /etc/profile
在最后面添加ant的路径
export ANT_HOME=/home/bymain/ant-1.9.7
export PATH=$PATH:$ANT_HOME/bin
 
使用source命令使配置文件生效。
source /etc/profile
 
3.命令行 输入ant -version验证下ant是否装成功。
4.下载 jasper-compiler-5.5.23.jar 、 jasper-runtime-5.5.23.jar也拷贝到 hive/lib 目录下
连接:https://mvnrepository.com/artifact/tomcat/jasper-runtime/5.5.23
6.通过ip:9999/hwi 可以访问到hive 的 hwi

 
posted @ 2020-01-08 16:12  鱼丸河粉  阅读(1745)  评论(0编辑  收藏  举报