Hive is an SQL parsing engine that allows you to create tables in hive and execute SQL statements. The created table is stored in HDFS, And the executed SQL statement is executed through mapreduce. It is too convenient to compile mapreduce jobs by executing SQL statements!
1. decompress and set the environment
Hive-0.9.0.tar.gz is used. Decompress and rename the files in the/usr/local directory.
Ta-xzvf hive-0.9.0.tar.gzmv hive-0.9.0 hive
Set the environment variable hive_home in/etc/profile, point to/usr/local/hive, and set the bin directory to the PATH variable.
2. Rename the configuration file
Rename the configuration file in the conf directory and execute
MV hive-env.sh.template hive-env.shmv hive-default.xml.template
3. modify configuration information
Modify the hadoop hadoop-env.sh (otherwise the hive is started to report the error of the class not found)
Export hadoop_classpath =.: $ classpath: $ hadoop_classpath: $ hadoop_home/bin
Modify the hive-config.sh for $ hive_home/bin by adding the following three lines
Export java_home =/usr/local/jdkexport hive_home =/usr/local/hiveexport hadoop_home =/usr/local/hadoop
4. Start
First, make sure that hadoop is running, and then execute the command hive to enter the hive command line.
Okay, you have done it!