Hive is the basic architecture of data warehouse built on Hadoop. It provides a series of tools for data extraction, conversion, and loading (ETL). This is a mechanism for storing, querying, and analyzing large-scale data stored in Hadoop. Hive defines a simple SQL-like query language, known as HQL, which can be used to retrieve Hadoop storage data, and all query operations are completed based on MapReduce.
This article describes how to quickly install the Hive component. Hive is easy to install and configure. You only need to ensure that HDFS and MapReduce are running correctly to start our installation journey. Let's take a look at how to install the Hive component quickly and easily!
1. Download Hive
Download Address: http://www.apache.org/dyn/closer.cgi/hive select the version to download
2. Move Hive to the/usr/hadoop directory and decompress it.
Music hive-1.1.0.tar.gz/usr/; cd/usr
Tar-zxvf hive-1.1.0.tar.gz
3. Use the root user to authorize hive-1.1.0
Chown-R hadoop: hadoop hive
4. Add hive-1.1.0 environment variables
Vi. bash_profile
Export JAVA_HOME =/usr/java/jdk1.6
Export JRE_HOME =/usr/java/jdk1.6/jre
Export HADOOP_HOME =/usr/hadoop
Export HIVE_HOME =/usr/hive
Export HBASE_HOME =/usr/hbase
Export CLASSPATH =.: $ CLASSPATH: $ JAVA_HOME/lib: $ JRE_HOME/lib
Export PATH = $ PATH: $ JAVA_HOME/bin: $ JRE_HOME/bin: $ HADOOP_HOME/bin: $ HIVE_HOME/bin: $ HBASE_HOME/bin
5. Configure the Hive configuration file
(1) configure the hive-conf.sh in the/usr/hive/bin directory
HADOOP_HOME =/usr/hadoop
Export HIVE_CONF_DIR =/usr/hive/conf
(2) configure hive-default.xml and hive-site.xml
Cd/usr/hive/conf
Cp hive-default.xml.template hive-default.xml
Cp hive-site.xml.template hive-site.xml
Cp hive-exec-log4j.properties.template hive-exec-log4j.properties
Cp hive-log4j.properties.template hive-log4j.properties
Chown-R hadoop-hadoop hive-default.xml
Chown-R hadoop-hadoop hive-site.xml
Chown-R hadoop-hadoop hive-exec-log4j.properties
Chown-R hadoop-hadoop hive-log4j.properties
6. Start Hive
# Su-hadoop
# Hive
7. Test
Hive> create table test (key string );
Hive> show tables;
If the above Command shows the test table we just created, it proves that we have completed the Hive construction work correctly!