Hive网络接口的使用

该博客已经完全转移到http://sunhs.me

中并增加更多新的技术内容(hadoop为

主),欢迎访问!

 
1.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>/home/asheng/hive/hive-0.10.0/lib/hive-hwi-x.x.x.war</value>
<description>this is the war file with the jsp content for hive web interface</description>
</property>

 

2.开启服务

    hive --service hwi

    出现错误:

     FATAL hwi.HWIServer: HWI WAR file not found at /home/asheng/hive/hive-0.10.0/home/asheng/hive/hive-     0.10.0/lib/hive_hwi.war

    解决方法:

    配置文件hive-site.xml中要进行相应的修改(不用写绝对路径,相对路径即可):

<property>
<name>hive.hwi.war.file</name>
<value>lib/hive-hwi-0.10.0.war</value>
<description>this is the war file with the jsp content for hive web interface</description>
</property>

 

3.访问网络接口

浏览器访问http://IP:9999/hwi

点击Browse Schema就可以查看相应的数据库了,点击数据库名称查看数据库下所有表的信息,点击表名就可以查看表的具体信息

4.hive查询

    <1>创建一个session会话(ListSessions会列出所有的会话,hive重启后,所有的session丢失)

    <2>输入查询语句,点击查询即可

该博客已经完全转移到http://sunhs.me

中并增加更多新的技术内容(hadoop为

主),欢迎访问!

猜你喜欢

转载自oaksun.iteye.com/blog/1946363