CenOS7下Hive Web搭建

Hive的Hive Web接口

     HWI提供了CLI的一种备选方案,但对于那些希望点击按钮就能够完成创建表,查询的用户来说不是那么完善,因为在HWI中依然要输入Hive QL进行操作,而这也是快速学习Hive QL的一种途径,因为只有越频繁的使用才能够使用的越熟练。

1.去官网下载http://archive.apache.org/dist/hive/hive-0.13.1/

CenOS7下Hive Web搭建

2.进入hwi目录,cd /usr/local/hive/apache-hive-0.13.1-src/hwi/

jar cfM hive-hwi-0.14.0.war -C web .

3.#在hwi目录下,输入这个命令,将文件压缩成.wer,

4、cp hive-hwi-0.13.1.war /usr/hdp/2.6.2.0-205/hive/lib/

#将war压缩包拷到hive的lib目录下,jsp-2.1-6.1.14.jar和jdk的tools.jar拷到hive的lib目录下

5、  修改hive-site.xml中关于HWI的配置如下:

<property>  

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

  <value>lib/hive-hwi-0.13.1.war</value>  

  <description>This sets the path to the HWI war file, relative to ${HIVE_HOME}. </description>  

</property>  

<property>  

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

  <value>knowyou-03.knowyou.com</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>  

6.重启hive集群

输入hive --service hwi &,后台启动hive web interface接口,

       在浏览器中输入http://192.168.1.72:9999/hwi结果如下图所示:

CenOS7下Hive Web搭建

       在右侧可以输入用户名和所属的组进行授权,这样就可以使用该用户进行操作,如下图所示:

CenOS7下Hive Web搭建

       或者不输入用户信息直接点击左侧导航栏中的Browse Schema按钮,直接浏览默认schema。在右侧点击default,然后再点击pokes(这是在CLI中创建的表),信息如下图所示:

CenOS7下Hive Web搭建

       点击左侧导航栏最下面的Diagnostics按钮,将会在右侧列出系统属性:

CenOS7下Hive Web搭建

       点击左侧的Create Session按钮以创建新的会话:

CenOS7下Hive Web搭建

       输入会话名称并点击Submit按钮:

CenOS7下Hive Web搭建

       可以在上图中输入查询语句,结果文件名,将Start Query改为YES,并提交。点击左侧的List Session按钮将会显示当前的会话:

CenOS7下Hive Web搭建