一. hwi即 HiveWebInterface,在启动前,先要配置好相应的war包。
1. 在apache官网下载好对应Hive版本的源码文件
2. 解压此压缩文件,在hwi目录下找到web文件夹。
3. 将这个web文件夹打包为war包,执行命令:jar cvfM0 hive-hwi-2.1.1.war -C web/ .
4. 将此war包传到Linux中Hive目录下的lib文件夹中。
5. 修改配置文件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 port 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>
</property>
二、网页启动Hive时的异常及解决
1. 在windows的浏览器中启动localhost:9000/hwi/发现以下异常:
The following error occurred while executing this line: jar:file:/home/linux/application/hive2.1.1/lib/ant-1.9.1.jar!/org/apache/tools/ant/antlib.xml:37: Could not create task or type of type: componentdef.
Ant could not find the task or a class this task relies upon.
2. 异常解决:经过多次摸索,发现了以下解决方案,亲测有效。
下载1.10.5版本的ant,将lib中的ant.jar文件重命名为ant.1.10.5.jar并移动到hive的lib目录下,执行chmod 777 ant.1.10.5.jar. 重新执行hive --service hwi 即可。