MapR 5.0 Documentation : Integrate Hue with Hive

Complete the following steps to integrate Hue with Hive: 

1. Edit the hue.ini file

Complete the following steps in the beeswax section of the hue.ini file:

  1. Configure the hive_server_host and hive_server_port properties.  This step is not required on a single node cluster.

    # 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.
  2. 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

    If Hue and Hive are installed on separate nodes, you must also copy the Hive conf directory to the Hue node. 

  3. For Hive 0.13: If you want to view logs during query execution, set use_get_log_api to true. From Hive 1.0 onward, this value does not need to be set to true in order to view the logs during query execution.  

    If you install Hue and Hive 0.13 with the MapR Installer, the MapR Installer automatically performs this step.  

2. Configure 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 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)

Configure Shared Hive Data and Metadata Directories for Hue

  1. Change the hive.metastore.uris property as shown:

      <description> URI where clients contact Hive metastore server </description>

    The hive.metastore.warehouse.dir property can keep its default value and does not need to be changed.

  2. Enable Hue impersonation by setting the following property to true.

      <description> Set this property to enable Hive Metastore service impersonation in unsecure mode.
       In unsecure mode, setting this property to true causes the metastore to execute DFS operations
       using the client's reported user and group permissions. Note that this property must be set on
       BOTH the client and server sides. </description>
  3. Set the location of the sharelib.

  4. To enable the Hive Metastore service to share the embedded Derby database, add the following property blocks to the hive-site.xml file on the node running hiveserver2 to point to the location of the Derby metastore:

      <value>jdbc:derby:;databaseName=/<local dir>/metastore_db;create=true</value>
      <description>JDBC connect string for a JDBC metastore</description>
      <description>Driver class name for a JDBC metastore</description>
  5. To enable the Hive Metastore service to share a MySQL database, add the following property blocks to the hive-site.xml file:

      <description>Substitute the actual username</description>
      <description>Substitute the actual password</description>

Configure Separate Hive Data and Metadata Directories for Hue:

If you want to store Hue data and metadata in separate directories from Hive data and metadata, follow these steps:

  1. Copy hive-site.xml to a new location. (The original hive-site.xml file remains in the previous location for use by Hive.)
  2. Edit hue.ini and change the hive_conf_dir property so it points to the new location for hive-site.xml.
  3. Change the hive.metastore.warehouse.dir property in the new hive-site.xml file so it points to the directory where Hue data will be located.
  4. Change the hive.metastore.uris property so it points to the directory for Hue's metastore_db.
  5. Set the hive.metastore.execute.setugi property to true, as shown in step 2 above.

3. Additional Configurations

Perform any additional Hue configurations and then restart Hue so that the changes will take effect.  See Starting the Hue Webserver