Disclaimer: This blog does not configure MySQL, the meta-database for Derby
If you want to configure MySQL, click: http://blog.csdn.net/gamer_gyt/article/details/47776369
First, the environment
Ubuntu14.04
hadoop2.6 Pseudo-Distribution (installation tutorial Please refer to: Click to open the link)
hive-1.2.1 (DOWNLOAD link: Click to open link) ii. installation
1, the download of the installation package to the appropriate directory, in this small part is/usr/local/hadoop/
TAR-ZXVF apache-hive-1.2.1-bin.tar.gz-c/usr/local/hadoop
Rename operation (for subsequent convenience)
MV Apache-hive-1.2.1-bin Hive
2, configure the Environment variables hive (in this note, the profile of the small part is not configured), it does not elaborate
3. Modify several template templates under hive/conf and rename them to other
CP hive-env.sh.template hive-env.sh
CP hive-default.xml.template hive-site.xml
4, configure the hive-env.sh file as shown in the figure:
5. Modify the Hive-site.xml file
Before you modify it, create the directory accordingly so that it
The path corresponds, otherwise an error will be made when running hive.
Mkdir-p/usr/local/hadoop/hive/warehouse
Mkdir-p/usr/local/hadoop/hive/tmp
Mkdir-p/usr/local/hadoop/hive/log
There are a lot of configuration items in this file and they are very long, so be patient.
Of course, you can also find (ctrl+f) by searching for a matching string:
Type '/hive.metastore.warehouse.dir ' (carriage return)
will be locked to the desired string.
Three of them need to be modified:
<property>
<name>hive.metastore.warehouse.dir</name>
<value>/usr/local/hadoop/hive/warehouse</value>
</property>
This is the SET data directory
-------------------------------------
<property>
<name>hive.exec.scratchdir</name>
<value>/usr/local/hadoop/hive/tmp</value>
</property>
This is the set temp file directory
--------------------------------------
<property>
<name>hive.querylog.location</name>
<value>/usr/local/hadoop/hive/log</value>
</property>
This is the directory used to store hive-related logs
The rest is not modified.
6. If the configuration starts hive to this end, the error will be as follows:
Workaround:
1. View the Hive-site.xml configuration and see the configuration value with "System:java.io.tmpdir" configured
2. Create a new folder/usr/local/hadoop/hive/log
3. Change the value of the configuration item containing "System:java.io.tmpdir" to the address above
Sometimes the above error will occur when the modification is complete, and the following processing is done:
The Hive/lib/jline-2.12.jar can be copied to the hadoop/share/hadoop/yarn/lib/directory, the original jlie to delete the
cp/usr/local/hadoop/hive/lib/jline-2.12.jar/usr/local/hadoop/share/hadoop/yarn/lib/
Rm-r/usr/local/hadoop/share/hadoop/yarn/lib/jline-0.98.jar
Note: The version is different jline name will vary, depending on your own
7. Copy Tools.jar (the jar package underneath the Lib package of the JDK) to Hive/lib
Start Hive, success.
8. Start the command:
Go to Hive's extract directory, execute bin/hive, enter
Start Hive Web service: bin/hive--service hwi
Port access as shown in Figure http://127.0.0.1:9999/hwi/:
yes!
Three: Web interface usage Instructions
User module (authorize, authentication module):
First understand the user authentication session relationship, in the HWI user and groups input users and belong to the user group, each user authentication (authorize) information corresponds to a set of session information, after hive Restart these session information will disappear:
Sessions module is interface and hive interaction, after hive restart, session information will be lost, create session, List Sessions (Session Management)
Start by creating a session search_all_databases (query all databases):
After the submission, click on the list Sessions, write the relevant information: result file is the output of the query results, error file is the wrong saved files, query write your HQL (note the end without semicolons), Start Query:yes, Click Submit
After clicking Submit, a view file appears behind the result file, and the query statement in the same form is automatically semicolon-clicked to display all the databases in hive after clicking View file (since there is only one default table in my hive, So only one is shown):
Database module is to display all databases:
Bottom:: Diagnostics is the relevant diagnostic information for the system HWI vs. CLI
If a friend who has used the CLI has seen the above introduction, it will certainly find a very serious problem: the execution of the process is not prompted. We don't know when a query execution ended.
Summarize the pros and cons of Hwi vs. CLI:
Pros: Hwi browser-enabled way to browse, convenient and intuitive.
Cons: No procedure prompt is executed.