Hive- Hive Web Interface

当我们安装好hive时候,我们启动hive的UI界面的时候,命令: hive –-service hwi ,报错,没有war包

我们查看hive/conf/hive-default.xml.template,查找hwi

把这3台属性复制,添加到hive-site.xml里面, vim hive-site.xml 

<property>
<name>hive.hwi.listen.host</name>
<value>192.168.1.88</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>   //注意红字的版本号和它的命名格式 : hive-hwi-xxx.war
<description>This sets the path to the HWI war file, relative to ${HIVE_HOME}. </description>
</property>

去官网下载hive的源码,根据你自己的Hive版本来下载

下载源码,把hwi的web目录打成war包,上传到HIVE_HOME/lib里面

jar cvf hive-2.1.1.war –C web/ .

 

然后打开浏览器执行http://192.168.1.88:9999/hwi/     注意写你的IP和端口口

执行的报错:

它少了tools.jar,我们到jdk的lib目录下,执行cp tools.jar /usr/hive/lib/

在启动hive –servcie hwi,又抛出异常

去到官网ant,这个时候需要下载ant,然后安装它

用ant –v查看是否安装成功。

把ant里面的lib目录下的ant.jar和ant.launcher.jar拷贝到hive/lib目录下

命令: cp ant.jar ant.launcher.jar /usr/hive/lib 

然后执行: hive --service hwi //注意是双减号 

 又出现错误:

jar:file:/usr/apache-hive-2.1.1-bin/lib/ant-1.9.1.jar!/org/apache/tools/ant/antlib.xml:37: Could not create task or type of type: componentdef.
进到hive的lib目录下,把原来里面的 ant给去掉
[root@srv01 lib]# mv ant-1.6.5.jar ant-1.6.5.jar.bak
[root@srv01 lib]# mv ant-1.9.1.jar ant-1.9.1.jar.bak
[root@srv01 lib]# mv ant-launcher-1.9.1.jar ant-launcher-1.9.1.jar.bak

然后再次启动即可: hive –service hwi 。

原文地址:https://www.cnblogs.com/RzCong/p/7325057.html