Integrate Hue with Hive

Describes how to integrate Hue with Hive through settings in the hue.ini file.

About this task

By default, Hue connects to a single instance of HiveServer2 through the hive_server_host parameter in hue.ini; however, if high availability (HA) is enabled for HiveServer2, Hue can leverage that. If one instance of HiveServer2 goes down, the client automatically connects to another instance of HiveServer2.

Verify the Hive Version

Before you integrate Hue with HiveServer2 (HA or single instance), verify that the path specified in the hive_conf_dir property applies to the Hive version that you have installed. If needed, update the path to reflect the Hive version that you have installed.
# Hive configuration directory, where hive-site.xml is located
hive_conf_dir=/opt/mapr/hive/hive-<version>/conf
If Hue and Hive are installed on separate nodes, you must also copy the Hive conf directory to the Hue node.

Integrating Hue with HiveServer2 High Availability

If you want Hue to leverage HiveServer2 HA, enable high availability for HiveServer2, and update the hue.ini file to include the following properties and settings:
[beeswax]
  #Whether to use service discovery for llap.
  hive_discovery_llap = true
  #Is llap (hive server interactive) running in HA.
  hive_discovery_llap_ha = true
  #Whether to use service discovery for HiveServer2.
  hive_discovery_hs2 = true
[libzookeeper]
  #ZooKeeper ensemble; comma-separated list of host/port.
  ensemble=<host:port>:5181

Note that the hive_server_host and hive_server_port properties in hue.ini are not required if using HiveServer2 HA. Service discovery overrides the server and thrift port.

Perform any additional Hue configurations and then restart Hue for changes to take effect. See Starting the Hue Webserver.

Integrating Hue with a Single Instance of HiveServer2

Update the beeswax section of the hue.ini file to include the following properties and settings:
NOTE This is not required on a single node cluster.
[beeswax]
 
# Host where HiveServer2 is running.
# If Kerberos security is enabled, use fully-qualified domain name (FQDN).
  hive_server_host=<FQDN of Hive Server>
 
# Port that HiveServer2 Thrift server runs on.
  hive_server_port=10000

Perform any additional Hue configurations and then restart Hue for changes to take effect. See Starting the Hue Webserver.

Configuring Data and Metadata Directories

When Hue and Hive are used together, they are usually configured to share metadata and data directories. However, you can create separate directories for Hue and Hive.

The locations of the shared directories are specified by the following properties in the hive-site.xml file:
  • hive.metastore.uris (the hostname and port of the Hive Metastore node)
  • hive.metastore.warehouse.dir (the directory where the default database for the warehouse is located)
See Configure Shared Hive Data and Metadata Directories for Hue and Configure Separate Hive Data and Metadata Directories for Hue for more information.