一 首先下载相应版本hive源码
我这里是: apache-hive-2.1.1-src.tar.gz
解压缩找到目录下面hwi文件夹里面有一个web文件夹
我们使用命令编辑成war包
一 :在命令行中找到hwi目录输入一下命令:
jar cvfM0 hive-hwi-2.1.1war -C web/ .
注意-C是大写 我第一次就写错了导致编译没有通过
最后在hwi文件夹下面生成一个hive-hwi-2.1.1.war包
二:把war包拷贝到/apache-hive-2.1.1-bin/lib/目录下方
三:拷贝jdk中的tools.jar到/apache-hive-2.1.1-bin/lib/目录下方
四:在hive-site.xml中添加如下参数
<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 part the Hive Web Interface will listen on</description>
</property>
<property>
<name>hive.hwi.war.file</name>
<value>lib/hive-hwi-2.1.1.war</value>
<description>This is the WAR file with the jso content for Hive Web Interface</description>
</property>
五:在命令行中运行命令
hive --service hwi