Hive installation (i) Environment configuration

Source: Internet
Author: User

Introduction to Hive Web Interface (HWI): Hive comes with a web-gui that doesn't function much, and can be used for effects, which is a good choice if you don't have hue installed.

Since there are no pages in the Hive-bin package that contain HWI, only the Java code-compiled jar package: Hive-hwi-1.0.1.jar

Therefore, you need to download the source code to extract the JSP file and package it into a war file into the Hive-lib directory:

CD apache-hive-1.0.1-src/Hwijar CfM hive-hwi-1.0.1.war-c web.

Finally, put the Hive-hwi-1.2.0.war into the Hive-lib directory to start the HWI service:

1 export hivelog= '/usr/local/hive/logs ' 2  3 #mkdir-p $hivelog  4  5  6  7 $HIVE _home/hive--service hiveserver2 > $hivelog/hiveserver2.log 2>&1 & 8< /c8> 9 $HIVE _home/hive--service metastore > $hivelog/metastore.log 2>&1 &11< /c11> $HIVE _home/hive--service hwi > $hivelog/hwi.log 2>&1 &

But found that Hwi failed to start, error:

ERROR Hwi. Hwiserver:hwi WAR File not found At/usr/local/hive/usr/local/hive/lib/hive-hwi-1.0.1.war

The cause is a bug in the Hwi startup script ($HIVE _home/bin/ext/hwi.sh):

Export hwi_war_file=$ (LS ${hive_lib}/hive-hwi-*.war)

The direct modification script is:

Export hwi_war_file=$ (ls $HIVE _lib/hive-hwi-*.war | awk-f/' {print "lib/" $NF} ')

Of course, you can also specify in the configuration file Hive-site.xml:

1<property>2 3<name>hive.hwi.war.file</name>4 5<value>lib/hive-hwi-1.0.1.war</value>6 7<description>this sets the path to the HWI war file, relative to ${hive_home}. </description>8 9</property>Ten  One<property> A  -<name>hive.hwi.listen.host</name> -  the<value>0.0.0.0</value> -  -<description>this is the host address the Hive Web Interface would listen on</description> -  +</property> -  +<property> A  at<name>hive.hwi.listen.port</name> -  -<value>9999</value> -  -<description>this is the port the Hive Web Interface would listen on</description> -  in</property>
View Code

Then visit url:http://ubuntu:9999/hwi/

However, continue to error:

1 ERROR compiler. Compiler:javac exception 2 Unable to find a Javac Compiler; Com.sun.tools.javac.Main are not on the Clas spath. 3 Perhaps Java_home does not point to the JDK. It is currently set to "/usr/local/java/jre"

Cause: When jetty compiles the JSP class, Ant does not recognize the correct JDK path.

Solve:

Ln-s $JAVA _home/lib/tools.jar $HIVE _home/lib/ or CP  $JAVA _home/lib/tools.jar/usr/lib/hive/lib/

Then visit url:http://ubuntu:9999/hwi/

However, continue to error: JSP parsing errors, the original is missing JSP package, the Jasper-compiler-5.5.23.jar, Jasper-runtime-5.5.23.jar and Jsp-2.1-6.1.14.jar copy to hive Lib.

Then visit url:http://ubuntu:9999/hwi/

and execute the CREATE table

CREATE TABLE table1 (foo STRING, bar map<string, string>)     ROW FORMAT delimited     ' t '       ', '     : '     STORED as textfile;

Create success, heart a burst of joy, and then create a table table2.

Perform

Load data local Inpath "/usr/local/hive/apache-hive-1.0.1-bin/examples/files/map_table.txt"  overwrite into table table1;

No problem, there seems to be no problem.

And then execute

Insert INTO table table2 Select Foo,bar from table1;

Another error.

The original hive-site.xml configuration file Jars.path A problem, commented out configuration.

Hive installation (i) Environment configuration

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.