Web界面安装: 下载apache-hive-0.14.0-src.tar.gz: 把 apache-hive-0.14.0-src.tar.gz\apache-hive-0.14.0-src\hwi\web 里的所有文件及文件夹打成war包,复制到hive/lib里面。 复制 tools.jar(jdk的lib包下面的jar包) 到 hive/lib下。 修改hive-site.xml <property> <name>hive.hwi.listen.host</name> <value>0.0.0.0</value> </property> <property> <name>hive.hwi.listen.port</name> <value>9999</value> </property> <property> <name>hive.hwi.war.file</name> <value>lib/hive-hwi.war</value> </property> 启动: hive --service hwi & 15/04/20 17:42:51 INFO mortbay.log: Extract /usr/local/hive-0.14.0/lib/hive-hwi.war to /tmp/Jetty_0_0_0_0_9999_hive.hwi.war__hwi__3rbmda/webapp 15/04/20 17:42:52 INFO mortbay.log: Started [email protected]:9999 网页输入:http://192.168.1.10:9999/hwi
<img src="http://img.blog.csdn.net/20150421212123888?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvYmFvbGliaW41Mjg=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="" />
</pre><pre name="code" class="java">
<img src="http://img.blog.csdn.net/20150421212010624?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvYmFvbGliaW41Mjg=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="" />
</pre><pre name="code" class="java">
<img src="http://img.blog.csdn.net/20150421212135260?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvYmFvbGliaW41Mjg=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="" />
JDBC模式: hive 远程服务 (端口号10000) 启动方式: [root@i-love-you hive-0.14.0]# ll bin 总用量 32 -rwxr-xr-x. 1 baozi games 881 11月 9 08:44 beeline drwxr-xr-x. 3 root root 4096 4月 19 19:23 ext -rwxr-xr-x. 1 baozi games 7311 11月 9 08:44 hive -rwxr-xr-x. 1 baozi games 1900 11月 9 08:44 hive-config.sh -rwxr-xr-x. 1 baozi games 885 11月 9 08:44 hiveserver2 -rwxr-xr-x. 1 baozi games 832 11月 9 08:44 metatool -rwxr-xr-x. 1 baozi games 884 11月 9 08:44 schematool [root@i-love-you hive-0.14.0]# bin/hiveserver2 SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/usr/local/hadoop/share/hadoop/common/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/usr/local/hive-0.14.0/lib/hive-jdbc-0.14.0-standalone.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation. SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory] 查看10000端口是否打开: [root@i-love-you ~]# netstat -pan |grep 10000 tcp 0 0 0.0.0.0:10000 0.0.0.0:* LISTEN 4629/java [root@i-love-you ~]# 在java代码中调用hive的JDBC建立连接