WebHCat Installed with Hive
WebHCat and HCatalog are 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
Hive installation is documented here.
WebHCat Installation Procedure
Note: WebHCat was originally called Templeton. For backward compatibility the name still appears in URLs, log file names, variable names, etc.
- Ensure that the required related installations are in place, and place required files into the Hadoop distributed cache.
- Download and unpack the HCatalog distribution.
- Set the
TEMPLETON_HOMEenvironment variable to the base of the HCatalog REST server installation. This will usually be same as
HCATALOG_HOME. This is used to find the WebHCat (Templeton) configuration.
- Review the configuration and update or create
webhcat-site.xmlas required. Ensure that site-specific component installation locations are accurate, especially the Hadoop configuration path. Configuration variables that use a filesystem path try to have reasonable defaults, but it's always safe to specify a full and complete path.
- Verify that HCatalog is installed and that the
hcatexecutable is in the
- Build HCatalog using the command
ant jarfrom the top level HCatalog directory.
- Start the REST server with the command "
hcatalog/sbin/webhcat_server.sh start" for Hive 0.11.0 releases and later, or "
sbin/webhcat_server.sh start" for installations prior to HCatalog merging with Hive.
Check that your local install works. Assuming that the server is running on port 50111, the following command would give output similar to that shown.
- Start the server:
sbin/webhcat_server.sh start(HCatalog 0.5.0 and earlier – prior to Hive release 0.11.0)
hcatalog/sbin/webhcat_server.sh start(Hive release 0.11.0 and later)
- Stop the server:
sbin/webhcat_server.sh stop(HCatalog 0.5.0 and earlier – prior to Hive release 0.11.0)
hcatalog/sbin/webhcat_server.sh stop(Hive release 0.11.0 and later)
- End-to-end build, run, test:
- Ant, version 1.8 or higher
- Hadoop, version 1.0.3 or higher
- ZooKeeper is required if you are using the ZooKeeper storage class. (Be sure to review and update the ZooKeeper-related WebHCat configuration.)
- HCatalog, version 0.5.0 or higher. The
hcatexecutable must be both in the
PATHand properly configured in the WebHCat configuration.
- Permissions must be given to the user running the server. (See below.)
- If running a secure cluster, Kerberos keys and principals must be created. (See below.)
- Hadoop Distributed Cache. To use Hive, Pig, or Hadoop Streaming resources, see instructions below for placing the required files in the Hadoop Distributed Cache.
Hadoop Distributed Cache
The server requires some files be accessible on the Hadoop distributed cache. For example, to avoid the installation of Pig and Hive everywhere on the cluster, the server gathers a version of Pig or Hive from the Hadoop distributed cache whenever those resources are invoked. After placing the following components into HDFS please update the site configuration as required for each.
Hive: Download the Hive tar.gz file and place it in HDFS. For example, for Hive version 0.11.0:
Pig: Download the Pig tar.gz file and place it into HDFS. For example, for Pig version 0.11.1:
Hadoop Streaming: Place
hadoop-streaming-*.jarinto HDFS. Use the following command:
where <templeton.streaming.jar> is a property value defined in
webhcat-default.xmlwhich can be overridden in the
webhcat-site.xmlfile, and <hadoop streaming jar> is the Hadoop streaming jar in your Hadoop version:
hadoop-1.*/contrib/streaming/hadoop-streaming-*.jarin the Hadoop 1.x tar
hadoop-2.*/share/hadoop/tools/lib/hadoop-streaming-*.jarin the Hadoop 2.x tar
Override Jars: Place override jars required (if any) into HDFS. Note: Hadoop versions prior to 1.0.3 required a patch (HADOOP-7987) to properly run WebHCat. This patch is distributed with WebHCat (located at
templeton/src/hadoop_temp_fix/ugi.jar) and should be placed into HDFS, as reflected in the current default configuration.
The location of these files in the cache, and the location of the installations inside the archives, can be specified using the following WebHCat configuration variables. (See the Configuration documentation for more information on changing WebHCat configuration parameters.) Some default values vary depending on release number; defaults shown below are for the version of WebHCat that is included in Hive release 0.11.0. Defaults for the previous release are shown in the HCatalog 0.5.0 documentation.
Default (Hive 0.11.0)
The path to the Pig archive.
The path to the Pig executable.
The path to the Hive archive.
The path to the Hive executable.
The path to the Hadoop streaming jar file.
Jars to add to the
Permission must be given for the user running the WebHCat executable to run jobs for other users. That is, the WebHCat server will impersonate users on the Hadoop cluster.
Create (or assign) a Unix user who will run the WebHCat server. Call this USER. See the Secure Cluster section below for choosing a user on a Kerberos cluster.
Modify the Hadoop core-site.xml file and set these properties:
A comma-separated list of the Unix groups whose users will be impersonated.
A comma-separated list of the hosts that will run the HCatalog and JobTracker servers.
To run WebHCat on a secure cluster follow the Permissions instructions above but create a Kerberos principal for the WebHCat server with the name
Also, set the WebHCat configuration variables
Proxy User Support
Proxy User Support in WebHCat allows the caller of WebHCat to instruct WebHCat to run commands on the Hadoop cluster as a particular user.
The canonical example is Joe using Hue to submit a MapReduce job through WebHCat. For the following description, assume Joe has the Unix name 'joe', Hue is 'hue' and WebHCat is 'hcat'. If Hue specifies 'doAs=joe' when calling WebHCat, WebHCat submits the MR job as 'joe' so that the Hadoop cluster can perform securitiy checks with respect to 'joe'. If the doAs value is not specified, the MR job will be submitted as user 'hue'.
To set up Proxy User Support, make the following edits in configuration files.
In hive-site.xml, set:
In webhcat-site.xml, set:
A comma-separated list of the Unix groups whose users may be impersonated by 'hue'.
A comma-separated list of the hosts which are allowed to submit requests by 'hue'. In the canonical example, this would be the servers running Hue.
In core-site.xml, make sure the following are also set:
A comma-separated list of the Unix groups whose users may be impersonated by 'hcat'.
A comma-separated list of the hosts which are allowed to submit requests by 'hcat'.