Installing Hive
Installing Hive is simple and only requires having Java 1.6 and Ant installed on your machine.
Hive is available via SVN at http://svn.apache.org/repos/asf/hive/trunk. You can download it by running the following command.
$ svn co http://svn.apache.org/repos/asf/hive/trunk hive
To build hive, execute the following command on the base directory:
$ ant package
It will create the subdirectory build/dist with the following contents:
- README.txt: readme file.
- bin/: directory containing all the shell scripts
- lib/: directory containing all required jar files)
- conf/: directory with configuration files
- examples/: directory with sample input and query files
Subdirectory build/dist should contain all the files necessary to run hive. You can run it from there or copy it to a different location, if you prefer.
In order to run Hive, you must have hadoop in your path or have defined the environment variable HADOOP_HOME with the hadoop installation directory.
Moreover, we strongly advise users to create the HDFS directories /tmp and /user/hive/warehouse
(aka hive.metastore.warehouse.dir) and set them chmod g+w before tables are created in Hive.
To use hive command line interface (cli) go to the hive home directory (the one with the contents of build/dist) and execute the following command:
$ bin/hive
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 (see conf/hive-default.xml), this location is ./metastore_db
Using Derby in embedded mode allows at most one user at a time. To configure Derby to run in server mode, look at HiveDerbyServerMode.
Installing HCatalog
Version
HCatalog is installed with Hive, starting with Hive release 0.11.0.
If you install Hive from the binary tarball, the hcat
command is available in the hcatalog/bin
directory. However, most hcat
commands can be issued as hive
commands except for "hcat -g
" and "hcat -p
". Note that the hcat
command uses the -p
flag for permissions but hive
uses it to specify a port number. The HCatalog CLI is documented here and the Hive CLI is documented here.
HCatalog installation is documented here.
Installing WebHCat (Templeton)
Version
WebHCat is installed with Hive, starting with Hive release 0.11.0.
If you install Hive from the binary tarball, the WebHCat server command webhcat_server.sh
is in the hcatalog/sbin
directory.
WebHCat installation is documented here.