Table of Contents |
---|
Installing Hive
You can install a stable release of Hive by downloading and unpacking a tarball, or you can download the source code and build Hive using Maven (release 0.13 and later) or Ant (release 0.12 and earlier).
Hive installation has these requirements:
- Java 1.7 (preferred).
Note: Hive versions 1.2 onward require Java 1.7 or newer. Hive versions 0.14 to 1.1 work with Java 1.6, but prefer 1.7. Users are strongly advised to start moving to Java 1.8 (see HIVE-8607). - Hadoop 2.x (preferred), 1.x (not supported by Hive 2.0.0 onward).
Hive versions up to 0.13 also supported Hadoop 0.20.x, 0.23.x. - Hive is commonly used in production Linux and Windows environment. Mac is a commonly used development environment. The instructions in this document are applicable to Linux and Mac. Using it on Windows would require slightly different steps.
Installing from a Tarball
Start by downloading the most recent stable release of Hive from one of the Apache download mirrors (see Hive Releases).
Next you need to unpack the tarball. This will result in the creation of a subdirectory named hive-x.y.z
(where x.y.z
is the release number):
No Format |
---|
$ tar -xzvf hive-x.y.z.tar.gz
|
Set the environment variable HIVE_HOME
to point to the installation directory:
No Format |
---|
$ cd hive-x.y.z
$ export HIVE_HOME={{pwd}}
|
Finally, add $HIVE_HOME/bin
to your PATH
:
No Format |
---|
$ export PATH=$HIVE_HOME/bin:$PATH |
Installing from Source Code (Hive 1.2.0 and Later)
Info | ||
---|---|---|
| ||
To build Hive 1.2.0 and later releases with Apache Maven, see Getting Started: Building Hive from Source. You will need Java 1.7 or newer. |
Installing from Source Code (Hive 0.13.0 and Later)
Info | ||
---|---|---|
| ||
To build Hive 0.13.0 and later releases with Apache Maven, see Getting Started: Building Hive from Source. |
Installing from Source Code (Hive 0.12.0 and Earlier)
Info | ||
---|---|---|
| ||
This section describes installation for Hive 0.12.0 and earlier releases, which use Apache Ant to build Hive. |
Installing Hive is simple and only requires having Java 1.6 and 6 and Ant installed on your machine (for Hive 0.12 and earlier).
Hive is available via SVN at http://svn.apache.org/repos/asf/hive/trunkbranches. You can download it by running the following command.
Code Block |
---|
$ svn co http://svn.apache.org/repos/asf/hive/trunk/branches/branch-#.# hive |
where #.#
is the Hive release number. For release 0.8.1, use "branch-0.8-r2
".
To build Hive, execute the following command on the base directory:
Code Block |
---|
$ ant package
|
It will create the subdirectory build/dist with the following contents:
...
Moreover, we strongly advise users to create the HDFS directories /tmp and /user/hive/warehouse (also known as hive.metastore.warehouse.dir) and set them chmod g+w before tables are created in Hive.
Next Steps
You can begin using Hive as soon as it is installed, although you will probably want to configure it first.
Hive CLI and Beeline CLI
To use the Hive command line interface (cliCLI) go to the Hive home directory (the directory and execute the following command:
Code Block |
---|
$ bin/hive
|
The Hive home directory is the one with the contents of build/dist ) and for Hive 0.12 and earlier; for Hive 0.13 and later it is packaging/target/apache-hive-<release_string>-bin/apache-hive-<release_string>-bin/.
HiveServer2 (introduced in Hive 0.11) has a new CLI called Beeline (see Beeline – New Command Line Shell). To use Beeline, execute the following command in the Hive home directory:
Code Block |
---|
$ bin/hive beeline |
Hive Metastore
Metadata is stored in an embedded Derby database whose disk storage location is determined by the Hive configuration variable named javax.jdo.option.ConnectionURL. By default, this location is ./metastore_db (see conf/hive-default.xml).
Using Derby in embedded mode allows at most one user at a time. To configure Derby to run in server mode, see Hive Using Derby in Server Mode.
To configure a database other than Derby for the Hive metastore, see Hive Metastore Administration.
Next Step: Configuring Hive.
...
HCatalog and WebHCat
HCatalog
Info | ||
---|---|---|
| ||
HCatalog is installed with Hive, starting with Hive release 0.11.0. |
...
HCatalog installation is documented here.
...
WebHCat (Templeton)
Info | ||
---|---|---|
| ||
WebHCat is installed with Hive, starting with Hive release 0.11.0. |
...